diff --git a/core/lib/Thelia/Core/Template/Loop/ProductSaleElements.php b/core/lib/Thelia/Core/Template/Loop/ProductSaleElements.php index aa4434100..a55d746b6 100644 --- a/core/lib/Thelia/Core/Template/Loop/ProductSaleElements.php +++ b/core/lib/Thelia/Core/Template/Loop/ProductSaleElements.php @@ -60,7 +60,7 @@ class ProductSaleElements extends BaseLoop implements PropelSearchLoopInterface new Argument( 'order', new TypeCollection( - new Type\EnumListType(array('min_price', 'max_price', 'promo', 'new', 'random')) + new Type\EnumListType(array('quantity','quantity_reverse','min_price', 'max_price', 'promo', 'new', 'random')) ), 'random' ) @@ -79,6 +79,12 @@ class ProductSaleElements extends BaseLoop implements PropelSearchLoopInterface foreach ($orders as $order) { switch ($order) { + case "quantity": + $search->orderByQuantity(Criteria::ASC); + break; + case "quantity_reverse": + $search->orderByQuantity(Criteria::DESC); + break; case "min_price": $search->addAscendingOrderByColumn('price_FINAL_PRICE', Criteria::ASC); break;