This is a discussion on Product Attributes - Option Type Feature 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 ...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
|
#1
| ||||
| ||||
| 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
|
| Sponsored Links | ||
| ||
| |
| Thread Tools | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Product Attributes - Option Type Feature | michael_s | New osCommerce Contributions | 1 | 02-06-2008 07:51 AM |
| Product Attributes - Option Type Feature | michael_s | New osCommerce Contributions | 0 | 09-08-2007 07:24 PM |
| Product Attributes - Option Type Feature | michael_s | New osCommerce Contributions | 0 | 08-07-2007 02:12 PM |
| Product Attributes - Option Type Feature | michael_s | New osCommerce Contributions | 0 | 05-17-2007 11:44 PM |
| Product Attributes - Option Type Feature | flypie | osCMax v1.7 Discussion | 1 | 09-15-2003 08:47 PM |