Side Show Design Posted March 30, 2005 Posted March 30, 2005 I am trying to set the order of attributes. Eg, Med, Large, XL, XXL. They are currently coming out in a random order. Not Alphabetical, not in the order I entered them, any help?
lokksta Posted March 30, 2005 Posted March 30, 2005 I am 99% sure that by default, osc displays attributes in ascending order, regardless of the order they were added. I am assuming you mean the product attributes display on product_info.php?
OceanRanch Posted March 30, 2005 Posted March 30, 2005 Ah, Tom that 1% got you.... ;) There is no sort in the default oscommerce code. You can install the contribution "Attribute sort" (look in contribution section) or do as I have done. I added a sort in my attribute drop down to sort alphabetically. Around line 147 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 . "' order by pov.products_options_values_name"); HTH Tom
Side Show Design Posted March 30, 2005 Author Posted March 30, 2005 I found this in a post from 2002... Add an extra column to your attributes table called order_by (don't use just "order" as it is a reserved keyword) and then insert numbers from 1 to whatever in order_by column, 1 being the 1st you want to show in the list and so on. Then do an ORDER BY order_by in the .sql HTH - this is the best way to do it (IMHO) as you can chop and change it really easily by simply accessing PHPMyAdmin or other GUI. Anybody have more recent info or a better way on how to add an "order_by" feature?
lokksta Posted March 30, 2005 Posted March 30, 2005 Ah, Tom that 1% got you.... ;) There is no sort in the default oscommerce code. You can install the contribution "Attribute sort" (look in contribution section) or do as I have done. I added a sort in my attribute drop down to sort alphabetically. Around line 147 in catalog/product_info.php HTH Tom <{POST_SNAPBACK}> Oops, sorry :unsure: Could have sworn it did it by default, but oh well. Thanks for clearing that up though Tom, I would have over looked it otherwise and it is something I want :thumbsup:
Jeremy at oddly enough Posted March 31, 2005 Posted March 31, 2005 If you want it to sort in the order you entered the attributes, then use Tom's code but change the very last phrase from ....products_options_values_name... to ...options_values_id... Jeremy
Recommended Posts
Archived
This topic is now archived and is closed to further replies.