osCommerce and osCMax shopping cart software forums

Shopping Cart Software

osCommerce with teeth!

 
 

Attributes disappearing when quantity is updated in shopping cart.

This is a discussion on Attributes disappearing when quantity is updated in shopping cart. within the New osCommerce Contributions forums, part of the osCommerce 2.2 Forums category; Attributes disappearing when quantity is updated in shopping cart. I just tried to fix my shoping cart by using this ...


Go Back   osCommerce and osCMax shopping cart software forums > osCommerce 2.2 Forums > New osCommerce Contributions

Register FAQ Members List Calendar Mark Forums Read


Free community membership! Fast easy FREE membership
Reply

 

LinkBack Thread Tools
  #1  
Old 06-22-2008, 01:01 PM
michael_s's Avatar
osCMax Developer

 
Join Date: Jul 2002
Location: Phoenix, AZ
Posts: 10,979
Thanks: 80
Thanked 345 Times in 324 Posts
Rep Power: 10
michael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond repute
Post Attributes disappearing when quantity is updated in shopping cart.

Attributes disappearing when quantity is updated in shopping cart.

I just tried to fix my shoping cart by using this contribution ..
And it works with the all option ecept the text field.

After that i use this code and it works in all case.

File
catalog/includes/classes/shopping_cart.php
Just replace this function
function update_quantity($products_id, $quantity = '', $attributes = '')
{
----
---
}

with this new
function update_quantity($products_id, $quantity = '', $attributes = '') {
global $customer_id;
if (empty($quantity)) return true; // nothing needs to be updated if theres no quantity, so we return true..

$this->contents[$products_id]['qty'] = $quantity;
// update database
if (tep_session_is_registered('customer_id')) tep_db_query("update " . TABLE_CUSTOMERS_BASKET . " set customers_basket_quantity = '" . $quantity . "' where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($products_id) . "'");

if (is_array($attributes)) {
reset($attributes);
while (list($option, $value) = each($attributes)) {
// BOM - Options Catagories
$attr_value = NULL;
if ( !is_array($value) ) {
$this->contents[$products_id]['attributes'][$option] = $value;
$attr_value = $value;
if (tep_session_is_registered('customer_id')) tep_db_query("update " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " set products_options_value_id = '" . (int)$value . "', products_options_value_text = '" . tep_db_input($attr_value) . "' where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($products_id) . "' and products_options_id = '" . (int)$option . "'");
} elseif ( isset($attributes[$option]['t']) && !empty($attributes[$option]['t']) ) {
$this->contents[$products_id]['attributes'][$option] = $value;
$attr_value = htmlspecialchars(stripslashes($attributes[$option]['t']), ENT_QUOTES);
if (tep_session_is_registered('customer_id')) tep_db_query("update " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " set products_options_value_id = '" . (int)$value . "', products_options_value_text = '" . tep_db_input($attr_value) . "' where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($products_id) . "' and products_options_id = '" . (int)$option . "'");
} elseif ( isset($attributes[$option]['c']) ) {
$this->contents[$products_id]['attributes'][$option] = $value;
foreach ($value as $v) {
$attr_value = $v;
if (tep_session_is_registered('customer_id')) tep_db_query("update " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " set products_options_value_id = '" . (int)$value . "', products_options_value_text = '" . tep_db_input($attr_value) . "' where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($products_id) . "' and products_options_id = '" . (int)$option . "'");
}
}
// EOM - Options Catagories
}
}
}

Pls mail me in both case if this come useful to u or not

Thanks
kishore



More...
__________________
Michael Sasek
osCMax Developer


  • osCMax Templates - Hundreds of premium quality templates designed for osCMax 2. Loyalty discounts up to 30% off!
    Each purchase supports the osCMax project with much needed funds!

  • xShop for osCMax - Windows Based osCMax administration. Improved workflow, security, speed and convenience.

  • osCMax Hosting - From basic hosting to High Availability, Load Balanced arrays, the most experienced osCMax host. Default multi server configuration for exceptional performance!

  • osCMax Template Tutorial - Learn how to make your own custom templates and how to use the powerful features of the osCMax template system.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
Advertisement
  #2  
Old 11-15-2008, 05:29 PM
Lurker
 
Join Date: Nov 2008
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
justholidaystuff is on a distinguished road
Default Re: Attributes disappearing when quantity is updated in shopping cart.

Michael,
I tried to update but I get this error.

Parse error: syntax error, unexpected T_VARIABLE, expecting T_FUNCTION in /includes/classes/shopping_cart.php on line 237

Maby include all the code that has to be changed?

If anyone can help that would be great.

Thanks,
Mark
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3  
Old 11-15-2008, 11:32 PM
Lurker
 
Join Date: Nov 2008
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
justholidaystuff is on a distinguished road
Default Re: Attributes disappearing when quantity is updated in shopping cart.

I see now.

You just copy and paste the latest uploads from the oscommerce site.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
Advertisement
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

Thread Thread Starter Forum Replies Last Post
Fast Update to Shopping Cart Quantity michael_s New osCommerce Contributions 0 07-28-2007 03:37 AM
Shopping Cart Should Update Quantity when clicking Checkout Dubious osCMax v2 Customization/Mods 11 02-28-2007 01:04 PM
How to put the product attributes box in the shopping cart? loba osCMax v1.7 Discussion 0 03-23-2005 10:59 PM
Disappearing Orders b4damien osCommerce 2.2 Installation Help 0 01-12-2004 03:14 AM


All times are GMT -8. The time now is 06:40 PM.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO
http://www.oscmax.com/forums/
Copyright 2008 osCMax