Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

order the product options sensibly


Guest

Recommended Posts

Posted

Just a simple little thing I found. It's really annoying to me that if I have a lot of options on products, they appear in the drop down menu in random order. I'm building a bike site at the moment, and wanted the bike frame sizes to be in numerical order, so I fund the following bit of code:

$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 . "'");

 

and just before the end part which reads

");

I put in

 order by pov.products_options_values_name

(make sure you include that leading space)

this could have been any of the variables in that query, for example pa.options_values_price to sort by price or pov.products_options_values_id to sort by the order in which the values were entered in to the database.

 

Hope that helps y'all!! nice and simple, which is how I like it...

Posted

cool - please let us know how you got on!

  • 4 months later...
Posted
I was wondering where I can find this code that you modified.

 

Ah. I didn't realise I hadn't said that!!

 

I can't get to it at the moment (my local web/fileserver is down) but I'm fairly sure it was in the product_info.php file in the site root. If you still can't find it (it may look a little different depending on your version of OsCommerce) let me know and I'll have a look once I can access my files.

Archived

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

×
×
  • Create New...