Dieses Dokuwiki verwendet ein von Anymorphic Webdesign erstelltes Thema.

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:

$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 . "'");
With this line:
$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");

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:

$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 . "'");
With this line:
$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");

  • Bookmark at
  • Bookmark "Sort Product Options (attributes)" at Digg
  • Bookmark "Sort Product Options (attributes)" at Furl
  • Bookmark "Sort Product Options (attributes)" at Reddit
  • Bookmark "Sort Product Options (attributes)" at Google
  • Bookmark "Sort Product Options (attributes)" at StumbleUpon
  • Bookmark "Sort Product Options (attributes)" at Technorati
  • Bookmark "Sort Product Options (attributes)" at Facebook
  • Bookmark "Sort Product Options (attributes)" at Twitter
  • Bookmark "Sort Product Options (attributes)" at Slashdot
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