Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Attribute Sorting


aclema

Recommended Posts

I've input a number of attributes for my items. Then went back and added more. Now I have two drop down lists which are beautiful except they are sorted by the order they were entered. I need to sort them alphabetically but can't seem to find out how. I've been through the contributions but they are either to sort by input sequence or attribute value. My values are $0 and I don't want it by input sequence since I'm always adding new things and want them to show up alphabetically.

 

Anyone have any ideas how I can achieve this?

 

Amanda

Link to comment
Share on other sites

I've input a number of attributes for my items. Then went back and added more. Now I have two drop down lists which are beautiful except they are sorted by the order they were entered. I need to sort them alphabetically but can't seem to find out how. I've been through the contributions but they are either to sort by input sequence or attribute value. My values are $0 and I don't want it by input sequence since I'm always adding new things and want them to show up alphabetically.

 

Anyone have any ideas how I can achieve this?

 

Amanda

 

No one has tried to do this??

Link to comment
Share on other sites

No one has tried to do this??

 

 

Just had a look and I think I've got it.

 

replace the following code in /catalog/product_info.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 . "'");

 

 

with this code:

 

 

$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 pov.products_options_values_name, pa.products_attributes_id");

 

 

 

 

and keep you fingers crossed :lol:

 

the replacement code can be thinned to:

 

 

$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 pov.products_options_values_name");

Link to comment
Share on other sites

Just had a look and I think I've got it.

 

replace the following code in /catalog/product_info.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 . "'");

with this code:

$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 pov.products_options_values_name, pa.products_attributes_id");

and keep you fingers crossed :lol:

 

the replacement code can be thinned to:

$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 pov.products_options_values_name");

 

 

 

 

THANK YOU !!!! YOU ARE WONDERFUL....WORKS PERFECT!!!

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...