Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

How to sort option name?


Holder

Recommended Posts

Uninstall the attribute sort contrib you put in, and try this:

 

You're looking in the file product_info.php for the line that says:

tep_db_query function for $products_options...blah,blah, at about line 134

When you find it add this to the end of the line :

 

. "' order by popt.products_options_values_name");

in place of the . "'"); that's there now

 

Or if you prefer put

 

. "' order by products_options_values_id");

 

then, all you need to do is make sure you link the attributes in the order you want them to appear, so that the id numbers are in ascending order (will display the attribute with the lowest id number first).

 

Jeremy

 

ps make sure you back up your files before making changes, as always!

Link to comment
Share on other sites

Jeremy at oddly enough

Thanks, I have understood...

I have changed

$products_options_name_query = tep_db_query("select distinct popt.products_options_id, popt.products_options_name from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "' order by popt.products_options_name");

On

$products_options_name_query = tep_db_query("select distinct popt.products_options_id, popt.products_options_name from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "' order by popt.products_options_id");

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...