From 8051b0021ecca1750176388ce17b606e857146bc Mon Sep 17 00:00:00 2001 From: Krystian Podemski Date: Tue, 13 Aug 2013 14:52:59 +0200 Subject: [PATCH] [*] CORE : Get instance of current category in category controller Get instance of category in for eg. module hook using: $category = $this->context->controller->getCategory() instead of new Category(1,1); --- controllers/front/CategoryController.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/controllers/front/CategoryController.php b/controllers/front/CategoryController.php index 33dfc3bf3..166ce0d2d 100644 --- a/controllers/front/CategoryController.php +++ b/controllers/front/CategoryController.php @@ -205,5 +205,13 @@ class CategoryControllerCore extends FrontController $this->context->smarty->assign('nb_products', $this->nbProducts); } + + /** + * Get instance of current category + */ + public function getCategory() + { + return $this->category; + } }