Issue
I have added one module hook manage box in PrestaShop 1.7 . Module is installed and i have created one hook called dispalybeforehome but it is not showing me in my module. how to register it ?
Solution
In your module during the installation, with the install
method you should add this snippet:
$this->registerHook('displayBeforeHome');
For example:
public function install()
{
return parent::install() and $this->registerHook('displayBeforeHome');
}
Then you have to create the hookDisplayBeforeHome
method in your module:
public function hookDisplayBeforeHome($params)
{
// do your stuff
return 'IT WORKS!';
}
Then in the template add the smarty snippet to call the hook:
{hook h='displayBeforeHome'}
That's all ;)
Answered By - marsaldev Answer Checked By - Candace Johnson (PHPFixing Volunteer)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.