Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Sorting the product attrubutes?


lindendesign

Recommended Posts

Posted

Hello there.

 

I wondered if there was way to give the attributes against the products a sort order.

 

I've got a size option set which contains small, medium and large and these are shown in a drop down box on the product page.

 

I want Medium to be selected by default, but Large is the default as it is in alphabetical order.

 

Is there anyway I can change this?

 

Thanks,

 

Craig

Craig Shaw

Linden Design

Posted

Hi Craig

 

I know the reply is outdated for you, but in case anyone else is looking. You want the attributes (I presume using QTPro contribution) to sort by e.g. S, M, L so no numberic or alphabetic order.

 

When you create the attributes (admin/products_attributes.php?) page you make sure you enter them in the logical order you wish them to be displayed in.

 

Then you order the pick lists by

order by products_options_values_id ASC

 

So for instance, in the file includes/classes/pad_base.php by add a sort order to the end of products_options_query i.e.

 

        
$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)$this->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 products_options_values_id ASC");

 

Now the pick lists will display the attributes in the order you inputted them in. It works, but you do have to be careful how you input the attributes in the first place.

Archived

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

×
×
  • Create New...