osCommerce and osCMax shopping cart software forums

Shopping Cart Software

osCommerce with teeth!

 
 

Product Attributes - Option Type Feature

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. ...


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-28-2008, 04:22 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 Product Attributes - Option Type Feature

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


  • 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
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
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


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


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