Jump to content

How to add a native hook to a module ?


AcidLava

Recommended Posts

Hello,

I'd like to hook ps_langageselector and ps_currencyselector on displayHeader.

Unfortunately, it seems that all the hooks are available except this one. I'm looking for a way to add this hook but I can't find any clear tutorial about adding a native hook to a module on PS 1.7.

Could you please help ?

Thanks.

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

Hello Mediacom87, thanks for your time.

I've seen this one but it's not very clear to me. In my case and for example, I make a folder ps_languageselector in override/modules, then a file ps_languageselector.php.

In the .php file I write :

public function install()
 {
     $this->registerHook('displayHeader');
 }

 public function hookDisplayHeader(array $params)
 {
     // Your code.
 }

What I am supposed to add in "Your code" ?

Thanks.

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

il y a une heure, AcidLava a dit :

😐

What do you want to do in displayHeader hook ?

this hook is to put something before body tag, like for script or meta or css. But for script or css you need to use another solution.

if you don’t clearly take time to explain clearly whet you want you can’t received a really interesting answer.

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