PrestaShop Forum

The best place in the world to ask questions about PrestaShop and get advice from our passionate community!

PrestaShop Forum

Jump to content

 

Hooks and Positions

2 replies to this topic
#1
Mogul

    PrestaShop Apprentice

  • Members
  • PipPip
  • 43 posts
Why do some modules only work when hooked to certain hooks?

Is there a way to change this?
Read my blog at http://www.AdamPatel.com

#2
Mogul

    PrestaShop Apprentice

  • Members
  • PipPip
  • 43 posts
I have since located code inside the PHP file of each module which I think identifies different hooks. I don't know exactly how it works yet, but I believe it identifies hooks on which certain modules may or may not exist.

Anyone else figured this out?
Read my blog at http://www.AdamPatel.com

#3
rocky

    PrestaShop Superstar

  • US Moderators
  • 9988 posts
Yes, each module has hook functions that define how the module should be displayed in different positions. If there is no hook for a position, then the module will not display if you put the module in that position. You can add a hook and simply have it display the same as another hook by using code like the following:


function hookRightColumn($params)
{
return $this->hookLeftColumn($params);
}


This code will display the module in the right column the same way as in the left column. You can do the same with other hooks.

I hope this helps.
Check out Nethercott Constructions for PrestaShop guides and modules. Like us on Facebook for news updates.