Answer the question
In order to leave comments, you need to log in
How to create hook in prestashop 1.6?
Tell me the info that I just didn’t try, but the hook does not appear in the "Modules\Location" section
Answer the question
In order to leave comments, you need to log in
I did everything as here prestatips.info/adding-new-hook-prestashop
1. Added a hook in the database:
2. Added CategoryController.php class to override/controllers/front/
class CategoryController extends CategoryControllerCore
{
/**
* @see CategoryControllerCore::initContent()
*/
public function initContent()
{
parent::initContent();
$this->context->smarty->assign(
'HOOK_CATEGORY_TOP', Hook::exec('displayCategoryTop')
);
}
}
{if $HOOK_CATEGORY_TOP}
<div class="hook_category_top">
{$HOOK_CATEGORY_TOP}
</div>
{/if}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question