00sapo Posted July 3, 2015 Share Posted July 3, 2015 Hi, I have a module in which I registered two hooks but I can't execute actions with them. Can anyone help me? This is the code part which is involved (I used Configuration::updateValue() to debug because I'm not shure on how to use ppp() in this case): public function install() { if (Shop::isFeatureActive()) Shop::setContext(Shop::CONTEXT_ALL); if (! parent::install() || ! $this->registerHook('actionCartSave') || ! $this->registerHook('displayOrderConfirmation')) { return false; } return true; } public function hookDisplayOrderConfirmation($params) { Configuration::updateValue('DEBUG' . __LINE__ . "-" . __FILE__, "yes"); } public function hookActionCartSave($params) { Configuration::updateValue('DEBUG' . __LINE__ . "-" . __FILE__, "yes"); } Link to comment Share on other sites More sharing options...
vekia Posted July 5, 2015 Share Posted July 5, 2015 instead of COnfiguraiton try to use echo "hook fired!"; die(); then you should see blank page with "hook fired" please note that: - action hook is invisible,you can only execute there some php scripts (it's not a hook that displays stuff) - displayORderConfirmation - not each payment module use this hook so it can be a case of payment module that you selected during order process 1 Link to comment Share on other sites More sharing options...
00sapo Posted July 6, 2015 Author Share Posted July 6, 2015 Thank you for the tip on how to debug action hooks... The problem was that after having inserted a hook, the module must be reinstalled, so that the hook is registered. 1 Link to comment Share on other sites More sharing options...
vekia Posted July 6, 2015 Share Posted July 6, 2015 Thank you for the tip on how to debug action hooks... The problem was that after having inserted a hook, the module must be reinstalled, so that the hook is registered. thank you for clarification where the problem was :-) 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