[*] 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);
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user