This is a discussion on Product Attributes Question within the osCMax v1.7 Installation forums, part of the osCMax v1.7 Forums category; Hello, Can someone please tell me how I can make my size drop down box appear in order like this ...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
|
#1
| |||
| |||
| 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. ![]() |
|
#2
| |||
| |||
| 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 |
|
#3
| ||||
| ||||
| Congratulations Auntie, Answering your own questions helps all of us out. |
|
#4
| |||
| |||
| 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. |
| Thread Tools | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Product Options / Product Attributes.. pulldown sorting.? | Preston | osCommerce 2.2 Discussion | 5 | 11-24-2005 07:53 PM |
| Specific Product Image based on chosen product attributes? | chrisrex | osCMax v2 Customization/Mods | 0 | 11-22-2005 09:41 AM |
| Product attributes | djlane | osCMax v1.7 Installation | 1 | 07-26-2005 08:38 AM |
| attributes - product options question | stevensdesign | osCMax v1.7 General Mods Discussion | 2 | 07-12-2005 12:46 PM |
| Product attributes | kellyw628 | osCMax v1.7 Discussion | 1 | 09-12-2003 12:58 PM |