sagitario Posted August 3, 2006 Posted August 3, 2006 How can I sort the product_listing by price automatically when I open the product list?
Guest Posted August 3, 2006 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; } }
sagitario Posted August 7, 2006 Author 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
Recommended Posts
Archived
This topic is now archived and is closed to further replies.