This is a discussion on Product Attributes - Option Type Feature within the New osCommerce Contributions forums, part of the osCommerce 2.2 Forums category; The following code restores the text attribute values when a user has added items to the cart before logging in. ...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
|
#1
| ||||
| ||||
| The following code restores the text attribute values when a user has added items to the cart before logging in. Without the fix, all text values were lost in the restore_contents logic. Files to modify /catalog/includes/classes/shopping_cart.php FIND: // OTF contrib begins //$attributes_query = tep_db_query("select products_options_id, products_options_value_id from " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " where customers_id = '" . $customer_id . "' and products_id = '" . $products['products_id'] . "'"); $attributes_query_raw = "select products_options_id, " . "products_options_value_id, products_options_value_text from " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($products['products_id']) . "'"; $attributes_query = tep_db_query($attributes_query_raw); // OTF contrib ends // OTF contrib begins if ($attributes['products_options_value_id'] == PRODUCTS_OPTIONS_VALUE_TEXT_ID) { $this->contents[$products['products_id']]['attributes_values'][$attributes['products_options_id']] = $attributes['products_options_value_text']; } // OTF contrib ends } REPLACE with //LPM fix to restore text attribute values to cart object $attributes_query = tep_db_query("select products_options_id, products_options_value_id, products_options_value_text from " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($products['products_id']) . "'"); while ($attributes = tep_db_fetch_array($attributes_query)) { $this->contents[$products['products_id']]['attributes'][$attributes['products_options_id']] = $attributes['products_options_value_id']; if ($attributes['products_options_value_id'] == PRODUCTS_OPTIONS_VALUE_TEXT_ID) { $this->contents[$products['products_id']]['attributes_values'][$attributes['products_options_id']] = $attributes['products_options_value_text']; } } //LPM 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 | 0 | 02-09-2008 07:31 PM |
| Product Attributes - Option Type Feature | michael_s | New osCommerce Contributions | 0 | 08-07-2007 03:12 PM |
| Product Attributes - Option Type Feature | michael_s | New osCommerce Contributions | 0 | 06-19-2007 03:21 AM |
| Product Attributes - Option Type Feature | michael_s | New osCommerce Contributions | 0 | 05-18-2007 12:44 AM |
| Product Attributes - Option Type Feature | adam71o | osCMax v2 Customization/Mods | 21 | 08-10-2006 03:19 PM |