Guest Posted May 3, 2006 Posted May 3, 2006 Hi! Is there any way to list the products after name, but with Z first and A last. Like if you press the "Product name" once and it changes to "Product name-" I want the sorting as standard sorting, is that possible without to much altering? Sorry for my bad english :blush:
veera Posted May 3, 2006 Posted May 3, 2006 Hi!Is there any way to list the products after name, but with Z first and A last. Like if you press the "Product name" once and it changes to "Product name-" I want the sorting as standard sorting, is that possible without to much altering? Sorry for my bad english :blush: Hello, catalog/index.php Find the code below 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; } } Replace with 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 pd.products_name desc"; break; } } Regards, veera
Guest Posted May 3, 2006 Posted May 3, 2006 Hello, catalog/index.php Find the code below 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; } } Replace with 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 pd.products_name desc"; break; } } Regards, veera Is it possible to order products by price as well? I want the least expensive items listed first... Would it work to change the code to pd.products_price??
veera Posted May 3, 2006 Posted May 3, 2006 Is it possible to order products by price as well? I want the least expensive items listed first...Would it work to change the code to pd.products_price?? hello 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+2 . 'a'; $listing_sql .= " order by final_price, pd.products_name desc"; break; } } use above code for order by price as well as product_name descending Regards, veera
Recommended Posts
Archived
This topic is now archived and is closed to further replies.