sfhbsf Posted November 13, 2015 Share Posted November 13, 2015 (edited) Hello I have this code and none of these hooks is showing. I have all caches deactivated and cleared cache. public function install() { return parent::install() && $this->registerHook('orderDetail') && $this->registerHook('header') && $this->registerHook('shoppingCart'); } public function hookDisplayShoppingCart($params) { echo "asdf"; exit(); } public function hookDisplayOrderDetail($params) { echo "asdf"; exit(); } public function hookDisplayHeader(){ $this->context->controller->addCSS($this->_path.'css/mymodule.css', 'all');} Edited November 13, 2015 by sfhbsf (see edit history) Link to comment Share on other sites More sharing options...
sfhbsf Posted November 13, 2015 Author Share Posted November 13, 2015 The code is correct isnt it? What am I doing wrong? Please help. Thanks. Link to comment Share on other sites More sharing options...
lenny_ Posted November 13, 2015 Share Posted November 13, 2015 Your code looks correct. The hookDisplayShoppingCart fires when the buyer lands on steps 1 and 5 of the checkout process. Are you sure that the module is installed and initialized correctly? Try adding: if (!parent::install() || !$this->registerHook('header') || !$this->registerHook('payment') || !$this->registerHook('paymentReturn') || !$this->registerHook('displayShoppingCart')) { return false; } To the install method - if all of the hooks are not installed correctly the module itself will not be installed so you will know there is a problem. If it does install then you should be able to use your hooks. 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