From 4fcb9a84a0ead187596b8a533865a3ce156b775c Mon Sep 17 00:00:00 2001 From: rGaillard Date: Fri, 21 Sep 2012 13:50:21 +0000 Subject: [PATCH] // Fix #PSCFV-4200 --- 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;