Community Add-Ons

Add file to this package
Top » Features

Product Attributes Sort Order v1.0
for osCommerce Online Merchant v2.2

Product Attributes are read out from the database and placed into a select box, however the top most attribute becomes the default, with no way to override or set the sort order of the options. This may result in a default item with a price different from the posted price.

Operating on the assumption that price modifiers should be specificaly selected by the user, this mod adds a sort_order field to the product_atributes table and to the products_attributes.php, and product_info.php pages to allow user ordering of these attributes.

Legend:  Download   Report
Expand All / Collapse All
Small Update + Full Package faaliyet 17 May 2008  

In the file admin/products_attributes.php

Bug is fixed to clone products attributes

Find:
case 'clone_attributes':
$clone_product_id_from = $HTTP_POST_VARS['clone_products_id_from'];
$clone_product_id_to = $HTTP_POST_VARS['clone_products_id_to'];
tep_db_query("delete from ".TABLE_PRODUCTS_ATTRIBUTES." WHERE products_id='".$clone_product_id_to."'");
$attributes = tep_db_query("select products_id, options_id, options_values_id, options_values_price, price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES ." where products_id='".$clone_product_id_from."'");

while($attributes_values = tep_db_fetch_array($attributes)) {

tep_db_query("INSERT INTO " . TABLE_PRODUCTS_ATTRIBUTES . " ( products_id, options_id, options_values_id, options_values_price, price_prefix ) VALUES (".$clone_product_id_to.", ".$attributes_values['options_id'].", ".$attributes_values['options_values_id'].", ".$attributes_values['options_values_price'].", '".$attributes_values['price_prefix']."')");

}
break;

Replace with:

case 'clone_attributes':
$clone_product_id_from = $HTTP_POST_VARS['clone_products_id_from'];
$clone_product_id_to = $HTTP_POST_VARS['clone_products_id_to'];
tep_db_query("delete from ".TABLE_PRODUCTS_ATTRIBUTES." WHERE products_id='".$clone_product_id_to."'");
$attributes = tep_db_query("select products_id, options_id, options_values_id, options_values_price, price_prefix, attribute_sort from " . TABLE_PRODUCTS_ATTRIBUTES ." where products_id='".$clone_product_id_from."'");

while($attributes_values = tep_db_fetch_array($attributes)) {

tep_db_query("INSERT INTO " . TABLE_PRODUCTS_ATTRIBUTES . " ( products_id, options_id, options_values_id, options_values_price, price_prefix, attribute_sort) VALUES (".$clone_product_id_to.", ".$attributes_values['options_id'].", ".$attributes_values['options_values_id'].", ".$attributes_values['options_values_price'].", '".$attributes_values['price_prefix']."' , ".$attributes_values['attribute_sort'].")");

}
tep_redirect(tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, $page_info));
break;

That's all.

Full Package is included.

(The file(products_attributes) is concordant with version RC2a.)

(Products Attributes Sort Order + Products Attributes Clone Tool)

+Working Perfect...

Notice: if someone wants to install this manually, must check my previous packages

2 updates - 2 Bugs are Fixed faaliyet 2 May 2008  
Product Attributes Sort Order v1.6 faaliyet 19 Apr 2008  
Bug elsaliliana 26 Jan 2008  
Versão em Portugues (Brasil) apopular 23 Nov 2006  
Attrib sort v1.2a (+ instructions in Spanish) DCP 21 Nov 2006  
Integrate Attributes Sort Order v.1.11 with Product Tabs1.5 rabbitseffort 9 Jul 2006  
1.2 Yari Gio 29 Mar 2005  
Option order slav 8 Dec 2004  
Product Attributes Sort Order v1.0 Mark Wilmoth 3 Jul 2004  
Product Attributes Sort Order v.1.11 Erika G. 24 Mar 2004  
Product Attributes Sort Order v.1.0.1 Lynette L. 29 Feb 2004  
Product Attributes Sort Order v1.04 Erik McCarty 29 Feb 2004  
Product Attributes Sort Order v1.03 Erik McCarty 31 Jan 2004  
Product Attributes Sort Order v1.01 Erik McCarty 30 Jan 2004  
Product Attributes Sort Order v1.0 Erik Wayne McCarty 26 Jan 2004