erikwoods Posted September 18, 2005 Share Posted September 18, 2005 Is there a way to re-order the product attributes? I have 42 different colors (defined in the product attributes) for each product and I want the colors to appear in alphabetical order even if I add more colors later. Can this be done? Link to comment Share on other sites More sharing options...
Jeremy at oddly enough Posted September 18, 2005 Share Posted September 18, 2005 You're looking in the file product_info.php for the line that says: tep_db_query function for $products_options at line 134 When you find it add this to the end of the line : . "' order by products_options_values_name"); in place of the . "'"); that's there now Try this, it should sort the drop down box by the name of the option value. Jeremy Link to comment Share on other sites More sharing options...
erikwoods Posted September 18, 2005 Author Share Posted September 18, 2005 Ok I'll try that in a second. Thanks. Link to comment Share on other sites More sharing options...
erikwoods Posted September 18, 2005 Author Share Posted September 18, 2005 Something's not right. In product_info.php the line you're talking about says $products_options_name_query = tep_db_query("select distinct popt.products_options_id, popt.products_options_name from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "' order by popt.products_options_name"); Is this the statement you were talking about? If so, there are no empty quotes, and changing it from popt.products_options_name to popt.products_options_values_name did not work. Any idears? Link to comment Share on other sites More sharing options...
Jeremy at oddly enough Posted September 18, 2005 Share Posted September 18, 2005 It could be that the line number is incorrect. I've made changes to so many files, I've lost track of exactly what I've done. I'll look at an unchanged file and see, there could be a couple of similar bits of code right in that area if I remember correctly. Jeremy Link to comment Share on other sites More sharing options...
Jeremy at oddly enough Posted September 18, 2005 Share Posted September 18, 2005 Ok, looks like you changed line 131, which has an order by clause in it. Change that back to the original, which is ... (int)$languages_id . "' order by popt.products_options_name"); 3 lines below that, this is the line I mean: $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 . "'"); At the end of the line where it says $languages_id . "'"); you add in the order clause, like so: blahblahblah... $languages_id . "' order by products_options_values_name"); Try that, Jeremy Link to comment Share on other sites More sharing options...
erikwoods Posted September 20, 2005 Author Share Posted September 20, 2005 That worked Jeremy. Thank you very much. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.