Guest Posted May 27, 2004 Share Posted May 27, 2004 Hi, Im adding in Product Attributes into some of my catalog items, and i was wondering how you change the order? It would be nice to see these ordered via price..? At this stage they are all over the place and looks very messy.. Link to comment Share on other sites More sharing options...
Paycheck Posted May 27, 2004 Share Posted May 27, 2004 In your catalog/product_info.php on approximately line 141 you will se this line of script: $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"); See where it says order by popt.products_options_name ? You can change this to say order by popt.products_options_price $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_price"); JM Always remember, we need patience, guidance and most of all understanding. My Contributions Link to comment Share on other sites More sharing options...
Guest Posted December 21, 2004 Share Posted December 21, 2004 In your catalog/product_info.php on approximately line 141 you will se this line of script: $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"); See where it says order by popt.products_options_name ? You can change this to say order by popt.products_options_price $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_price"); JM <{POST_SNAPBACK}> I tried this and I get an error I would like to order my attributes by size. Can some give me so guidence. I tried changing the code to option_value_id. Because these have been entered in the correct order. Thanks :( Link to comment Share on other sites More sharing options...
chrismole Posted July 4, 2005 Share Posted July 4, 2005 Did anyone get this to work? I am trying to order my options dropdown list alphabetically and it's not working. The code above shows the list should be ordering by "name" by default, which should be alphabetically, but it's not. I also tried ordering by "id", but no luck there either. The order seems to be random. How do I control the order of the options in the dropdown list? Thanks, C Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.