Dieses Dokuwiki verwendet ein von Anymorphic Webdesign erstelltes Thema.

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

changing_product_attributes_sort_order [2007/12/28 22:54] (current)
Line 1: Line 1:
 +===== Sort Product Options (attributes) =====
 +
 +**Option 1**
 +
 +What it does... First - sorts by price Second - if price is same (or 0), it sorts based on the order that the option was entered.
 +
 +File to change ... /​catalog/​product_info.php
 +
 +Replace this line:
 +<code php>
 +$products_options_query = tep_db_query("​select pov.products_options_values_id,​ pov.products_options_values_name,​ pa.options_values_price,​ pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '"​ . (int)$HTTP_GET_VARS['​products_id'​] . "'​ and pa.options_id = '"​ . (int)$products_options_name['​products_options_id'​] . "'​ and pa.options_values_id = pov.products_options_values_id and pov.language_id = '"​ . (int)$languages_id . "'"​);​
 +</​code>​
 +With this line:
 +<code php>
 +$products_options_query = tep_db_query("​select pov.products_options_values_id,​ pov.products_options_values_name,​ pa.options_values_price,​ pa.price_prefix,​ pa.products_attributes_id from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '"​ . (int)$HTTP_GET_VARS['​products_id'​] . "'​ and pa.options_id = '"​ . (int)$products_options_name['​products_options_id'​] . "'​ and pa.options_values_id = pov.products_options_values_id and pov.language_id = '"​ . (int)$languages_id . "'"​ . " order by pa.options_values_price,​ pa.products_attributes_id"​);​
 +</​code>​
 +
 +
 +**Option 2**
 +
 +What it does.... If you want to sort solely by the order the option was entered (regardless of price) instead use this:
 +
 +File to change ... /​templates/​[templatename]/​content/​product_info.tpl.php
 +
 +Replace this line:
 +<code php>
 +$products_options_query = tep_db_query("​select pov.products_options_values_id,​ pov.products_options_values_name,​ pa.options_values_price,​ pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '"​ . (int)$HTTP_GET_VARS['​products_id'​] . "'​ and pa.options_id = '"​ . (int)$products_options_name['​products_options_id'​] . "'​ and pa.options_values_id = pov.products_options_values_id and pov.language_id = '"​ . (int)$languages_id . "'"​);​
 +</​code>​
 +With this line:
 +<code php>
 +$products_options_query = tep_db_query("​select pov.products_options_values_id,​ pov.products_options_values_name,​ pa.options_values_price,​ pa.price_prefix,​ pa.products_attributes_id from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '"​ . (int)$HTTP_GET_VARS['​products_id'​] . "'​ and pa.options_id = '"​ . (int)$products_options_name['​products_options_id'​] . "'​ and pa.options_values_id = pov.products_options_values_id and pov.language_id = '"​ . (int)$languages_id . "'"​ . " order by pa.products_attributes_id"​);​
 +</​code>​
 +
 +
  
changing_product_attributes_sort_order.txt ยท Last modified: 2007/12/28 22:54 (external edit)
You are here: startchanging_product_attributes_sort_order
Dieses Dokuwiki verwendet ein von Anymorphic Webdesign erstelltes Thema.
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0