rootnl2k Posted October 18, 2012 Posted October 18, 2012 A question , how do you change default sort on a catalogue? In this case We have http://www.geeandgeeracing.com/hoosiertires/ and going down the catalog say to http://www.geeandgeeracing.com/hoosiertires/index.php/road-racing-road-racing-wets-biasradial-c-58_86_88 we want to sort by part number . How can this be done?
♥ecartz Posted October 19, 2012 Posted October 19, 2012 Look for code (perhaps around line 158) in index.php that says something like if ( (!isset($HTTP_GET_VARS['sort'])) || (!preg_match('/^[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; } } } else { and change it to say something like if ( (!isset($HTTP_GET_VARS['sort'])) || (!preg_match('/^[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_MODEL') { $HTTP_GET_VARS['sort'] = $i+1 . 'a'; $listing_sql .= " order by p.products_model, pd.products_name"; break; } } } else { Two lines changed. None added or removed. Note: I would guess that what you call part number is what osCommerce calls products_model, but it could be something else. Always back up before making changes.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.