Jump to content

Adding actions to existing hooks


Recommended Posts

Hello,

 

Is it possible to add some functions to already created hooks? As example I need to fire my function before the logout function goes off. There is a hook called actionCustomerLogoutBefore I believe, how could I add my own function to it? 

Link to comment
Share on other sites

That is the whoel purpose of hooks. Adding functionality during the process.

 

You need to create a module that can be hooked to the hook. A method called "hookActionCustomerLogoutBefore($param)" need to be implemented in your module's class, then you can hook it in "install" or via your admin.

 

I don't know for this specific hook, if it exists and it is coded, I don't see why not.

 

Martin.

Link to comment
Share on other sites

Yes I have a module and a function named hookActionCustomerLogoutBefore inside of it. I use die() inside that function but it doesn't work, logout still works as normal. Am I missing something?

 

 

EDIT. oh yeah, I had to register the hook in my module. I thought that it's not necessary because the hook was already created.

Edited by The50 (see edit history)
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...