PDA

View Full Version : Product Attributes Question



auntie22
02-02-2004, 06:15 PM
Hello,

Can someone please tell me how I can make my size drop down box appear in order like this small, medium, large, x-large, 1x, 2x, 3x for some reasone it is showing up like this 1x, 2x, 3, large, medium, small, x-large. The order is all mixed up.

Please help.

Thanks in advance. :cry:

Anonymous
02-03-2004, 05:15 PM
Hello,
I have managed to answer my own question for the osC template. I hope this answer will help many with the same question?

If you have the option to switch templates and you are using the osC template this is the fix for the sort order in product attributes:
Go to catalog/templates/ osc/content and on line 88 you will see this:
$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 . "'");

Change to this if you don’t want to worry about alphabetic or numeric order That way you are not stuck with alphabetic, or numeric ordering, you can control the order that the attributes show according to the order that you enter them. $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 . "'"."order by pov.products_options_values_id"); (I used this one, and it worked great)

Change to this for sort by attribute value: $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 . "'". "order by pov.products_options_values_name" ); with this one Then in your product attributes just make sure your values are set up alphabetically

Try both and see wich one works for you

neil
02-06-2004, 04:14 PM
:D
Congratulations Auntie,
Answering your own questions helps all of us out. :D

In-Overtime
03-09-2004, 06:30 AM
Awesome - worked excellent for my application. I had 30 attributes per product, ranging from 1 -30 and they were coming up all out of order.

Thanks for outlining.