Sinister-Racing Posted December 3, 2003 Share Posted December 3, 2003 I am having a problem with the way the product attributes are sorted in the catalog. The sizes of the boots are messed up and I know It's because of how they were inserted in the admin section but I dont know how to fix it. Here is the site so you can see what I mean. http://www.sinister-racing.com/catalog/pro...products_id=253 If anybody can help that would be great, I have been racking mybrain on this for countless evenings. Thanks, Mike Link to comment Share on other sites More sharing options...
_Matt Posted December 3, 2003 Share Posted December 3, 2003 I'm very new to osCommerce so I'm not entirely sure if this will solve your problem. That said I would try adding an ORDER BY clause to the $products_options_query in product_info.php (line 134 in mine). E.g $products_options_query = tep_db_query("select pov.products_options_values_id, ............ pov.language_id = '" . (int)$languages_id . "' ORDER BY pov.products_options_values_name"); Of course any single digit sizes would need to be prefixed by a zero to keep the order correct. To reverse the order add DESC to the ORDER BY: ORDER BY pov.products_options_values_name DESC"); Hope that helps. Link to comment Share on other sites More sharing options...
Sinister-Racing Posted December 5, 2003 Author Share Posted December 5, 2003 Thanks, Matt But I am not sure if this is what you meant but I am getting errors, I am not sure if I missed something like a space or a quote around the BOLD area in the code below..... any suggestions $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"); Link to comment Share on other sites More sharing options...
_Matt Posted December 5, 2003 Share Posted December 5, 2003 It looks like you missed a single quote before ORDER: "' ORDER..... I.e. double quote, single quote, space ORDER Link to comment Share on other sites More sharing options...
Jeremy at oddly enough Posted December 5, 2003 Share Posted December 5, 2003 Try this, you'll get even more control over the order of the display, as long as you put the attributes in in order: $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 products_options_values_id"); That's line 134, and the drop down box will display the options in the order their id numbers run from lowest to highest. Link to comment Share on other sites More sharing options...
_Matt Posted December 5, 2003 Share Posted December 5, 2003 I think the problem is that he has already entered the attributes out of order and so needs to sort by something other than id. Link to comment Share on other sites More sharing options...
Sinister-Racing Posted December 5, 2003 Author Share Posted December 5, 2003 Thanks Guys, That worked perfectly. The code was right and Now I am saved a ton of work. Thanks again, Mike Sinister-Racing.com Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.