Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Product Attributes


1800contacts

Recommended Posts

I am having problem with the product attributes. In admin/catalog/product attributes, i set up the product name with option name, option value. The option value is numerical value from 1 to 10. When I preview it from catalog/product_info, the drop down shows the option value numerical vlaue in random orders. Can anyone please tell me how to sort them in orders? Without figure this out, I can't go on input the rest of the data. Thanx.

Richard da bomb

Link to comment
Share on other sites

In catalog/products_info.php you will find the select statement at about line 366 or thereabouts.

 

What you will want to do is to add an order by clause to the select statement. I modified mine to display "No Thanks" as the default selection. The "No Thanks" attribute has a options_value_price of 0.00, therefore it will always come up as the first select option.

 

You would probably just want to use order by pov.products_options_values_id

 

Here is the modified code:

 

 

$products_options = 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 = '" . $HTTP_GET_VARS['products_id'] . "' and pa.options_id = '" . $products_options_name_values['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . $languages_id . "' order by pa.options_values_price asc");

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...