The easiest way to add a hook in Prestashop 1.7

I recently discovered the list of modules from FriendsOfPresta: https://friendsofpresta.org/fr/modules and among this list, the module fop_console allows to add commands to Prestashop.

You can install it simply by downloading the zip file of the module.

In this module, the command fop:add-hook allows you to create a hook by giving it a name and a title in this way:

 ./bin/console fop:add-hook --name=displayMyCustomHook --title=displayMyCustomHook

Feel free to add modules to it after declaring it in one of the templates of your active theme 🙂

{hook h='displayMyCustomHook'}


P.S: remember to add this custom hook and associated modules in your config/theme.yml file 😉



in Prestashop Posted on Jun 11, 2021