in includes/modules/pages/advanced_search_result/header_php.php
I changed the code to below, but when I search on my website, the search results are still sorted by Product ID. What can I do to make the results sorted by Product added date?
PHP Code:
/*------------------------------------------------------*/
$productsort = array();
$nsort = array('New Arrival','Item Name','Price(Low to high)','Price(High to low)','Bestselling');
for ($i=1; $i<6; $i++) {
$productsort[] = array('id' => sprintf('%2d', $i), 'text' =>$nsort[$i-1] );
}
$pagesize = array();
$pagesize[] = array('id'=>24,'text'=>24);
$pagesize[] = array('id'=>36,'text'=>36);
$pagesize[] = array('id'=>48,'text'=>48);
if(isset($_GET['productsort']) && (int)$_GET['productsort'] > 0){
switch ($_GET['productsort']){
case 2:
$product_sort = " order by pd.products_name ";
break;
case 3:
$product_sort = " order by p.products_price";
break;
case 4:
$product_sort = " order by p.products_price DESC";
break;
case 5:
$product_sort = " order by p.products_ordered DESC";
break;
default:
$product_sort = " order by p.products_date_added DESC";
}
}
Bookmarks