WolwX Posted January 31, 2017 Share Posted January 31, 2017 Hello I created a custom theme, in prestashop 1.6.0.9, and I add two new hooks in it. My new hooks works fine, but I have a problem on an important point. I can't transplant any natives modules in them, only modules I created or I modified to include the two new hooks work fine for transplantation. So it's a way to do that, without core modification ? Thanks for your help. Link to comment Share on other sites More sharing options...
Knowband Plugins Posted February 1, 2017 Share Posted February 1, 2017 This works without any problem, we have done it in multiple modules. You must be doing something wrong. Please share the fragment of code that you have used to create the hook, so that we can have a look. Link to comment Share on other sites More sharing options...
WolwX Posted February 1, 2017 Author Share Posted February 1, 2017 To be sure we speak about the same thing, that's into a prestashop 1.6.0.9, and my hooks works fine with my custom themes and customs modules But, if I don't add thoses lines, the module won't be transplanted. Exemple with the blockcart module, with thoses lines that's ok, but without no public function install() { if ( parent::install() == false // || $this->registerHook('top') == false || $this->registerHook('header') == false || $this->registerHook('actionCartListOverride') == false /* Thoses line are needed to be able to use the hook */ || $this->registerHook('displayTopLeft') == false || $this->registerHook('displayTopRight') == false /* FIN */ || Configuration::updateValue('PS_BLOCK_CART_AJAX', 1) == false || Configuration::updateValue('PS_BLOCK_CART_XSELL_LIMIT', 12) == false || Configuration::updateValue('PS_BLOCK_CART_SHOW_CROSSSELLING', 1) == false) return false; return true; } and a bit more down : public function hookDisplayTopLeft($params) { $params['blockcart_top'] = true; return $this->hookTop($params); } public function hookDisplayTopRight($params) { $params['blockcart_top'] = true; return $this->hookTop($params); } The error code say "This module can't be transplant on this hook" Link to comment Share on other sites More sharing options...
rocky Posted February 9, 2017 Share Posted February 9, 2017 I think you'll need to override the native modules to allow them to be added to your custom hooks. For example, create override/modules/blockcart/blockcart.php with the following: <?php class BlockCartOverride extends BlockCart { public function hookDisplayTopLeft($params) { $params['blockcart_top'] = true; return $this->hookTop($params); } } 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