Guest Posted July 28, 2003 Posted July 28, 2003 I was wondering if there is a way to change the default product sorting with the column addon? If not is there a way to change the way the prev/next sorts the next & prev products. I would like them to be the same. So as the customers really go to the prev or next product. Thanks in Advance, alway k0nfuzed
Guest Posted July 28, 2003 Posted July 28, 2003 Well it was easy once I figured it out, they moved the code out of product_listing.php to index.php, so there is where u need to change this code: if ( (!$HTTP_GET_VARS['sort']) || (!ereg('[1-8][ad]', $HTTP_GET_VARS['sort'])) || (substr($HTTP_GET_VARS['sort'],0,1) > sizeof($column_list)) ) { for ($col=0, $n=sizeof($column_list); $col<$n; $col++) { if ($column_list[$col] == 'PRODUCT_LIST_MODEL') { $HTTP_GET_VARS['sort'] = $col+1 . 'a'; $listing_sql .= " order by pd.products_model"; break; } } } else { to sort whatever way you want. Hope this helps someone else
mdeloach Posted July 30, 2003 Posted July 30, 2003 I want to list products by date added. I can get the first page of products to sort just fine with the following code. The problem is that the NEXT and PREVIOUS buttons will sort by product name. Here is my code from index.php 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 . 'd'; $listing_sql .= " order by p.products_date_added"; break; } } I know that the 5th line pretty much controls how the NEXT/PREVIOUS buttons sort, but if I change that line to anything other than 'PRODUCT_LIST_NAME' the products will sort by product_id. How can I get all the pages to sort by date added? I have been extremely frustrated in trying to get this to work right. Here is something else I tried to no avail....I tried creating a new case in index.php, like this: case 'PRODUCT_LIST_DATEADD': $listing_sql .= "p.products_date_added " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name"; break; When I try to use 'PRODUCT_LIST_DATEADD' in place of 'PRODUCT_LIST_NAME' in the 5th line of the code mentioned at top, I see the same result....the products will sort by product_id. Someone Please Help me...I'd really like to get my client's site live without hacking the code so much as to manually list the order of products. Sorry if I've rambled a bit...I'm losing sleep over what should be a simple problem. Any help would truely be appreciated... Frustrated, - Matt :shock:
gewoon09 Posted January 10, 2006 Posted January 10, 2006 Does anyone know how to change the code of the previous_next file, so that it will sort on sort_order, instead of date_added or on product_id? I could not find a thread on this specific adjustment. Thank you in advance!
Recommended Posts
Archived
This topic is now archived and is closed to further replies.