Jump to content
HaCos

[SOLVED] Create a new hook / position

Recommended Posts

Hello, whats the easier way to create a new hook / module position in my template in order to use newsletter module ? 

Share this post


Link to post
Share on other sites

in simple words:

 

1) create new hook for example: afterTop 

INSERT INTO `ps_hook` (`id_hook`, `name`, `title`, `description`, `position`, `live_edit`) VALUES (NULL, 'AfterTop', 'After the top', 'This hook displays content after the top hook', 1, 1); 

2) create function in your module to support this hook, 

public function hookAfterTop($params){
// do something
} 

3) transplant module to this new hook

  • Like 1

Share this post


Link to post
Share on other sites

in simple words:

 

1) create new hook for example: afterTop 

INSERT INTO `ps_hook` (`id_hook`, `name`, `title`, `description`, `position`, `live_edit`) VALUES (NULL, 'AfterTop', 'After the top', 'This hook displays content after the top hook', 1, 1); 

2) create function in your module to support this hook, 

public function hookAfterTop($params){
// do something
} 

3) transplant module to this new hook

Thanks, it works like a charm :) 

Share this post


Link to post
Share on other sites

glad to hear that :-)

i marked topic title as [solved]

with regards,

Milos

  • Like 1

Share this post


Link to post
Share on other sites

Am new to Prestashop , I want to create a new position in the footer.

 

New record added to the table "ps_hook", as mentioned above.  My question is To which module should i add this function to enable it in the back end.

 

And what else i have to do.

Thanks.

Share this post


Link to post
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...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More