From b4aba5e8f3f3e9d3b008d1961a5ba3a96d41cfa3 Mon Sep 17 00:00:00 2001 From: rGaillard Date: Fri, 21 Sep 2012 13:50:21 +0000 Subject: [PATCH] // Fix #PSCFV-4200 git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17465 b9a71923-0436-4b27-9f14-aed3839534dd --- classes/ProductSale.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/classes/ProductSale.php b/classes/ProductSale.php index 973fb52b1..789c284d1 100644 --- a/classes/ProductSale.php +++ b/classes/ProductSale.php @@ -66,7 +66,9 @@ class ProductSaleCore { if ($page_number < 0) $page_number = 0; if ($nb_products < 1) $nb_products = 10; - if (empty($order_by) || $order_by == 'position') $order_by = 'sales'; + + $final_order_by = $order_by; + if (empty($order_by) || $order_by == 'position' || $order_by = 'price') $order_by = 'sales'; if (empty($order_way)) $order_way = 'DESC'; $groups = FrontController::getCurrentCustomerGroups(); @@ -109,7 +111,7 @@ class ProductSaleCore $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($sql); - if ($order_by == 'price') + if ($final_order_by == 'price') Tools::orderbyPrice($result, $order_way); if (!$result) return false;