Guest Posted June 1, 2004 Share Posted June 1, 2004 I'd like my list of products to be presented sorted by Model Number instead of Product Name. (Unfortunately, there is no Part Number, so I'm using Model Number as a Part Number). I can change the columns these appear in, but it is always sorted by Product Name instead of number. Link to comment Share on other sites More sharing options...
Guest Posted June 1, 2004 Share Posted June 1, 2004 The documentation says that "Config - Product Listing -- This displays the order of your products listed in your store. Change the values for whatever product order you want." Actually this just displays the fields in the order specified, but the entire list of products is still always sorted by product name. The documentation looks like it should be changed to "This displays the order of the fields on each line" instead. Link to comment Share on other sites More sharing options...
user99999999 Posted June 1, 2004 Share Posted June 1, 2004 Try changing this arouund line 195 in index.php. From: $listing_sql .= " order by pd.products_name"; To: $listing_sql .= " order by pd.products_model"; Link to comment Share on other sites More sharing options...
Guest Posted June 1, 2004 Share Posted June 1, 2004 Thanks for the suggestion. I tried that, but got error 1054: unknown column "pd.products_model" in "order clause". Link to comment Share on other sites More sharing options...
Guest Posted June 1, 2004 Share Posted June 1, 2004 I also tried "order by p.products_model", and this works for the first page of products. But the second and subsequent pages are presented in a scrambled order. Seems strange that you can't list products by product numbers. I suppose I have two circumventions: 1. make the products page long enough to handle all the products, or 2. prefix my product names with the product number, duplicating this information. Link to comment Share on other sites More sharing options...
user99999999 Posted June 1, 2004 Share Posted June 1, 2004 Sorry, Your right should be p. Now look for some more 'order by' statements and make it sort how you want it. Link to comment Share on other sites More sharing options...
Guest Posted June 2, 2004 Share Posted June 2, 2004 There are two places in index.php that have to be changed in order for the second and subsequent pages to be sorted by model. If you only change the first of these, the first page gets sorted by model, but other pages don't. I changed these two sections and it works fine: change pd.products_name to p.products_model in if ($column_list[$i] == 'PRODUCT_LIST_NAME') { $HTTP_GET_VARS['sort'] = $i+1 . 'a'; $listing_sql .= " order by p.products_model"; break; and change pd.products_name to p.products_model in case 'PRODUCT_LIST_NAME': $listing_sql .= "p.products_model " . ($sort_order == 'd' ? 'desc' : ''); Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.