From cafbed08ee039277400c8b85e1f53cd153beb6cb Mon Sep 17 00:00:00 2001 From: MatthieuB Date: Mon, 10 Jun 2013 21:13:23 +0200 Subject: [PATCH] NewProductController: new products page must display latest products first. Override default configuration values: cause the new products page must display latest products first. --- controllers/front/NewProductsController.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/controllers/front/NewProductsController.php b/controllers/front/NewProductsController.php index 7cf283eba..a438c4826 100644 --- a/controllers/front/NewProductsController.php +++ b/controllers/front/NewProductsController.php @@ -47,6 +47,13 @@ class NewProductsControllerCore extends FrontController $this->productSort(); + // Override default configuration values: cause the new products page must display latest products first. + if (!Tools::getIsset('orderway') || !Tools::getIsset('orderby')) + { + $this->orderBy = 'date_add'; + $this->orderWay = 'DESC'; + } + $nbProducts = (int)Product::getNewProducts( $this->context->language->id, (isset($this->p) ? (int)($this->p) - 1 : null),