Community Add-Ons

Add file to this package
Top » Features

Product Attributes - Option Type Feature
for osCommerce Online Merchant v2.2

The purpose of this contribution is to allow the use of various option types when setting up product attributes. With the current CVS version of osCommerce, all options are displayed with select lists for user input. This contribution specifically adds the ability to display options with text input boxes. This allows a store owner to collect customization/personalization information for a product from the end user. The contribution is written in such a way that the addition of other option types such as Radio Buttons should be reasonably simple to add.

Legend:  Download   Report
Expand All / Collapse All
FIX FOR: text attribute values do not transfer to order using paypal standard mmcfadden 21 Apr 2009  

I can't take credit for this but user sirspongey sent me his code that fixed this issue and it worked perfectly for me as well. I also noticed that the same issue was occurring in the confirmation emails that went out...the fix for that is listed below as well.

In the paypal_standard.php file do the following:

SEARCH FOR (at about line 245):
$sql_data_array = array('orders_id' => $insert_id,
'orders_products_id' => $order_products_id,
'products_options' => $attr_name,
'products_options_values' => $order->products[$i]['attributes'][$j]['value'],
'options_values_price' => $attributes_values['options_values_price'],
'price_prefix' => $attributes_values['price_prefix']);

tep_db_perform(TABLE_ORDERS_PRODUCTS_ATTRIBUTES, $sql_data_array);

REPLACE WITH:

// BOF Option Type Feature
$attr_name = $attributes_values['products_options_name'];

if ($attributes_values['products_options_id'] == PRODUCTS_OPTIONS_VALUE_TEXT_ID) {
$attr_name_sql_raw = 'SELECT po.products_options_name FROM ' .
TABLE_PRODUCTS_OPTIONS . ' po, ' .
TABLE_PRODUCTS_ATTRIBUTES . ' pa WHERE ' .
' pa.products_id="' . tep_get_prid($order->products[$i]['id']) . '" AND ' .
' pa.options_id="' . $order->products[$i]['attributes'][$j]['option_id'] . '" AND ' .
' pa.options_id=po.products_options_id AND ' .
' po.language_id="' . $languages_id . '" ';
$attr_name_sql = tep_db_query($attr_name_sql_raw);
if ($arr = tep_db_fetch_array($attr_name_sql)) {
$attr_name = $arr['products_options_name'];
}
}
//EOF Option Type Feature

$sql_data_array = array('orders_id' => $insert_id,
'orders_products_id' => $order_products_id,
// BOF Option Type Feature
//'products_options' => $attributes_values['products_options_name'],
//'products_options_values' => $attributes_values['products_options_values_name'],
'products_options' => $attr_name,
'products_options_values' => $order->products[$i]['attributes'][$j]['value'],
// EOF Option Type Feature
'options_values_price' => $attributes_values['options_values_price'],
'price_prefix' => $attributes_values['price_prefix']);
tep_db_perform(TABLE_ORDERS_PRODUCTS_ATTRIBUTES, $sql_data_array);

SEARCH FOR in the "before_process()" also in paypal_standard.php:

$products_ordered_attributes .= "nt" . $attributes_values['products_options_name'] . ' ' . $attributes_values['products_options_values_name'];

REPLACE WITH:

//$products_ordered_attributes .= "nt" . $attributes_values['products_options_name'] . ' ' . $attributes_values['products_options_values_name'];
$products_ordered_attributes .= "nt" . $attributes_values['products_options_name'] . ' ' . tep_decode_specialchars($order->products[$i]['attributes'][$j]['value']);

NOTE: DO NOT DOWNLOAD THE ATTACHED ZIP: it is an empty file, so pointless.

Bug - text attribute values do not transfer to order using paypal standard mmcfadden 21 Apr 2009  
FIX FOR: Attributes being mixed up after create account or logout. homewetbar 19 Feb 2009  
error fixed homewetbar 19 Feb 2009  
NOTICE: Important flaw in this contrib... nate_02631 25 Sep 2008  
TEXTAREA fix 2 skipper_al 9 Sep 2008  
Textarea zeigt den Wert nicht / Textarea doesn't show the value novacore 13 Jul 2008  
Retain text values LMason 28 Jun 2008  
Attributes disappearing when quantity is updated in shopping cart. arakishore 22 Jun 2008  
Attributes disappearing when quantity is updated in shopping cart. JorgeCosta 7 May 2008  
product_attributes_option_type_3.0 (updated for OsCommerce RC2a) Zeeshan Arshad 7 May 2008  
checkbox and raio reember fix cvanzo 27 Mar 2008  
Better support for text/area field pbor1234 8 Mar 2008  
Fix for OTF versions > 1.71 rich89 9 Feb 2008  
Attributes disappearing when quantity is updated in shopping cart. Dhananjaya 13 Jan 2008  
Advanced search with products attributes... faaliyet 17 Dec 2007  
product_attributes_option_type_2.02 by faaliyet ( Complete Package ) ( With Another "Product Attribute" Powerfull Packages ) faaliyet 14 Dec 2007  
Product Attributes - Option Type Feature v. 2.0.1 (Complete Package) stunami 8 Sep 2007  
Product Attributes - Option Type Feature v. 2.0.1 (manual install) jsruok 6 Sep 2007  
Textarea remember attributes bigjat69 7 Aug 2007  
Quantity multiplier v.1.0 - final - attachement ones more dracono 26 Jul 2007  
Quantity multiplier v.1.0 - final dracono 26 Jul 2007  
Quantity multiplier dracono 16 Jul 2007  
Broken quantity update after OTF dracono 16 Jul 2007  
Broken quantity update after OTF dracono 16 Jul 2007  
Product Attributes - Option Type Feature v. 2.0 (manual install) jsruok 2 Jul 2007  
Show attribute name properly 1.1 jsruok 19 Jun 2007  
Show attribute name properly jsruok 18 Jun 2007  
PAY PAL IPN fix sszelei 18 May 2007  
Update to Manual Installation PD_Steve 2 Sep 2006  
Manual Instal Instructions PD_Steve 28 Aug 2006  
Product Attributes - Option Type Feature v1.7.2 Gidgidonihah 17 May 2006  
Product Attributes - Option Type Feature v1.71 Didier Debbaut 17 Nov 2004  
Product Attributes - Option Type Feature v1.7 Didier Debbaut 7 Nov 2004  
Dutch products_attributes.php for 1.6 release. Stef Verlint 14 Aug 2004  
Changes in product_info.php to display Price with Tax Patrick_S 26 Jul 2004  
updated general.php James Rourke 9 Jun 2004  
Product Attributes - Option Type Feature v1.6 Chandra Roukema 3 Sep 2003  
Products Attributes - Option Type Feature v1.5 Chandra Roukema 30 Jul 2003  
Products Attributes - Option Type Feature v1.4 Chandra Roukema 16 Mar 2003  
Products Attributes - Option Type Feature v1.3 Chandra Roukema 9 Jan 2003  
Product Attributes - Option Type Feature v1.2 Chandra Roukema 25 Oct 2002  
Product Attributes - Option Type Feature v1.1 Chandra Roukema 6 Sep 2002  
Product Attributes - Option Type Feature v1.0 Chandra Roukema 11 Jun 2002