Jump to content

Prestashop hook and override module


Recommended Posts

I created a hook and I want to move there a module. I override the FrontController.php within the override folder (override/clases/controller/FrontController.php).


‘HOOK_HEADER’ => Module::hookExec(‘header’),

‘HOOK_TOP’ => Module::hookExec(‘top’),

‘HOOK_NEWHOOK’ => Module::hookExec(‘DisplayNewHook’),

‘HOOK_LEFT_COLUMN’ => Module::hookExec(‘leftColumn’)


Then I edited the php file module to add:

function hookNewHook($params) { return $this->hookTop( $params ); }

And it works correctly. But is not there another way to do this? Because if the module is updated, the changes will be lost.

Thank you very much.

Link to comment
Share on other sites

the only other way I know would be to create a new module based on the one you want to modify (in that way, in case of update of the original module), you will not lose your modification BUT you will not get the update of the module too.


There is no way for the moment to override the module php file, which is pitty.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...