88guy Posted November 16, 2007 Posted November 16, 2007 Maybe what I am trying to isn't possible - obviously, I'm not sure or I wouldn't be asking. The owner of our store (a mattress store) wants me to develop an ecommerce site. We sell mattresses and they come in King, Queen, Full, and twin sizes (mostly). When I try to add the various sizes of the same mattress (in a subcategory) they are displayed randomly. In other words, we should eventually have a lot of simiar pages which show a particular mattress in the sizes I just mentioned. But when I add them - even if I add King, then Queen, etc. (in ascending size and price, or descending size and price) they get jumbled around. They could go in either direction - but they need to go in one direction or the other (the smallest and cheapest first, or the other way around). I may not be explaing this very well so here's a page so you can see what I am trying to do: http://www.wholesalesleep.org/lowestcost/c...php?cPath=38_39 Is there a way to order the items in the categories?
Gauravs Posted November 16, 2007 Posted November 16, 2007 Take backup on index.php, Search following lines 191 if ( (!isset($HTTP_GET_VARS['sort'])) || (!ereg('[1-8][ad]', $HTTP_GET_VARS['sort'])) || (substr($HTTP_GET_VARS['sort'], 0, 1) > sizeof($column_list)) ) { 192 for ($i=0, $n=sizeof($column_list); $i<$n; $i++) { 193 if ($column_list[$i] == 'PRODUCT_LIST_NAME') { 194 $HTTP_GET_VARS['sort'] = $i+1 . 'a'; 195 $listing_sql .= " order by pd.products_name"; 196 break; 197 } 198 } Replace 195 $listing_sql .= " order by pd.products_name"; With 195 $listing_sql .= " order by final_price"; // First make only this change, then add ASC or DESC as per your requirement. Best Regards,Gaurav
88guy Posted November 16, 2007 Author Posted November 16, 2007 I'm 55 and just started fooling with PHP and MySQL in the last year - but that makes perfect sense. I am familiar with the MySQl directives and should of thought of that myself. But, I'm old and tired. I really, really appreciate your help!
Gauravs Posted November 16, 2007 Posted November 16, 2007 :) you are rather very young compared to the 'oldest' man on the planet!!! Cheers GS Best Regards,Gaurav
Guest Posted November 16, 2007 Posted November 16, 2007 :) you are rather very young compared to the 'oldest' man on the planet!!! Cheers GS But, not to me.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.