pulktisinghal Posted March 13, 2014 Share Posted March 13, 2014 (edited) I've read the 1.5 docs and gone through some of the forum posts around action hooks as well: http://www.prestashop.com/forums/topic/276894-how-to-use-action-hooks/?p=1392070 But there are still a few things that haven't been spelled out for me: (1) Who invokes action hook? An obvious assumption would be that action hooks are invoked by the core code and if that's correct, then: (2) Is it a given that to leverage an out-of-box action hook like actionValidateOrder or actionProductAttributeUpdate, the module must register itself with the same exact name? (3) If three completely different modules all want to have their action code triggered for actionProductAttributeUpdate, and they all register as: $this->registerHook('actionProductAttributeUpdate'); Then do they all get called whenever the event is triggered in PrestaShop. Sort of like a multicast? (4) If unique names are a factor when registering a hook then how can modules associate themselves with out-of-box action hooks/triggers? Edited March 13, 2014 by pulktisinghal (see edit history) Link to comment Share on other sites More sharing options...
NemoPS Posted March 14, 2014 Share Posted March 14, 2014 Hi! 1) you already answered, core files 2)Yes, and you must register them in the install function 3) yes, all of them will be executed 4) not sure I understood your question, can you clarify? Link to comment Share on other sites More sharing options...
pulktisinghal Posted March 14, 2014 Author Share Posted March 14, 2014 Thanks for confirming 1, 2 & 3. #4 was a question posed, in case, #2 was false "the module must register itself with the same exact name" which is not the case ... so you can ignore it. Thank You! 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