Jump to content

evi

Recommended Posts

 

Hi,,

 

i've a problem can anybody help me..?

 

i want to add some hook in modules prestashop..

but after the update, the hook that I make is lost,  help me how to create a hook to keep it there when the module in the update..

 

 

Thanks

Link to comment
Share on other sites

 Hi evi,

 

public function install()
    {
       
        return parent::install() && $this->registerHook('header') && $this->registerHook('displayAdminOrder') ;
    }

 

public function hookHeader()// This is your hook
    {
        add your function

return $this->display(__FILE__, 'your.tpl');
    }

Link to comment
Share on other sites

You have custom hook that is needed to be added manually in tpl file ?

 

I saw few different ways that developers deal with that problem.

 

Some create backup of original file and then replace tpl with file that contains custom hook.

But that works for default theme only so other solution is to have  check in modules back office.

That will see if specific code is there in tpl file and warn user to add code manually with detailed instructions.

 

Where you need that hook, maybe is possible to use some existing ?

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...