[-] FO - fixed bug #PSCFV-8826 sort now work fine on bestsale controller

This commit is contained in:
vAugagneur
2013-04-18 17:02:45 +02:00
parent e9b8af0e97
commit 828ffb74ad

View File

@@ -65,11 +65,9 @@ class ProductSaleCore
{
if ($page_number < 0) $page_number = 0;
if ($nb_products < 1) $nb_products = 10;
$final_order_by = $order_by;
if (empty($order_by) || $order_by == 'position' || $order_by = 'price') $order_by = 'sales';
if (empty($order_way) || $order_by == 'sales') $order_way = 'DESC';
if (is_null($order_by) || $order_by == 'position' || $order_by == 'price') $order_by = 'sales';
if (is_null($order_way) || $order_by == 'sales') $order_way == 'DESC';
$groups = FrontController::getCurrentCustomerGroups();
$sql_groups = (count($groups) ? 'IN ('.implode(',', $groups).')' : '= 1');
$interval = Validate::isUnsignedInt(Configuration::get('PS_NB_DAYS_NEW_PRODUCT')) ? Configuration::get('PS_NB_DAYS_NEW_PRODUCT') : 20;