The50 Posted November 29, 2016 Share Posted November 29, 2016 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 More sharing options...
Martin Uker K Posted November 29, 2016 Share Posted November 29, 2016 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 More sharing options...
The50 Posted November 29, 2016 Author Share Posted November 29, 2016 (edited) 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 November 29, 2016 by The50 (see edit history) Link to comment Share on other sites More sharing options...
Martin Uker K Posted November 29, 2016 Share Posted November 29, 2016 You need to register on install() OR adding trought "Modules-> Positions" else the application will not call your method in the your module. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now