sagitario Posted August 3, 2006 Share Posted August 3, 2006 How can I sort the product_listing by price automatically when I open the product list? Link to comment Share on other sites More sharing options...
Guest Posted August 3, 2006 Share Posted August 3, 2006 you could change it from the catalog\index.php instead of for ($i=0, $n=sizeof($column_list); $i<$n; $i++) { if ($column_list[$i] == 'PRODUCT_LIST_NAME') { $HTTP_GET_VARS['sort'] = $i+1 . 'a'; $listing_sql .= " order by pd.products_name"; break; } } use this for ($i=0, $n=sizeof($column_list); $i<$n; $i++) { if ($column_list[$i] == 'PRODUCT_LIST_PRICE') { $listing_sql .= " order by p.products_price"; break; } } Link to comment Share on other sites More sharing options...
sagitario Posted August 7, 2006 Author Share Posted August 7, 2006 Thank enigma1 for the help. :thumbsup: I try another way. for ($i=0, $n=sizeof($column_list); $i<$n; $i++) { if ($column_list[$i] == 'PRODUCT_LIST_PRICE') { $HTTP_GET_VARS['sort'] = $i+1 . 'a'; $listing_sql .= " order by p.products_price"; break; } } This way the prices are sort by price and you can sort by name our something else. :D Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.