Jump to content

Hook not fired


00sapo

Recommended Posts

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

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

  • Like 1
Link to comment
Share on other sites

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

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...