forevergalleries Posted February 24, 2004 Share Posted February 24, 2004 Is it possible to sort products listed in a category by price? Is it possible to order product attributes by price? Link to comment Share on other sites More sharing options...
forevergalleries Posted February 24, 2004 Author Share Posted February 24, 2004 I should say the default sort order on the category Link to comment Share on other sites More sharing options...
forevergalleries Posted February 24, 2004 Author Share Posted February 24, 2004 Alright. Found it myself. In index.php starting at Line 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)) ) { 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; } Change to: if ( (!isset($HTTP_GET_VARS['sort'])) || (!ereg('[1-8][ad]', $HTTP_GET_VARS[ 'sort'])) || (substr($HTTP_GET_VARS['sort'], 0, 1) > sizeof($column_list)) ) { 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 final_price"; break; } This checks HTTP_GET_VARS['sort'] to see if it is set. (in url sort=???) If it's not it searches for PRODUCT_LIST_NAME ... but I wanted PRODUCT_LIST_PRICE to be default so I reassigned it and then I change the order by to reflect the appropriate database column. Thanks Chris Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.