Guest Posted June 16, 2004 Posted June 16, 2004 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...
spayce_girl Posted June 23, 2004 Posted June 23, 2004 Thanks, I'm going to try this as I do NOT like how the ordering works.
o17e Posted November 2, 2004 Posted November 2, 2004 I was wondering where I can find this code that you modified.
Guest Posted November 3, 2004 Posted November 3, 2004 I was wondering where I can find this code that you modified. <{POST_SNAPBACK}> 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.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.