Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

How do I set the order of attributes?


Side Show Design

Recommended Posts

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?

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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

 

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:

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...