Jump to content

Module Custom Hook on product page


Jatin51

Recommended Posts

We are creating a custom module, WE created a custom hook "customPackage" in it.

 

We need to put that hook inside the product page without changing the prestashop default product page .tpl file. Need to know how can we execute that hook on product page from our custom module.

 

We First register hook using :

 $this->registerHook('customPackage');

 

Then we create function :

public function hookCustomPackage($params){

 .......

}

 

In product.tpl of theme we execute hook using :

<div id='myCustomHook'> {hook::exec('customPackage')}  </div>

 

But we want to execute hook on product.tpl without write above line in product.tpl.

 

Please help to execute this hook from our custom module.

 

Thank you,

Edited by Jatin51 (see edit history)
Link to comment
Share on other sites

  • 3 weeks later...

you can spawn your new hook from other hook (but it will appear in default hook)

 

for example:

hook function displayProductFooter($params){
return $this->hookCustomPackage($params);
}

then associate your module with productFooter hook.

  • Like 1
Link to comment
Share on other sites

×
×
  • Create New...