Hyperion_ Posted October 8, 2014 Share Posted October 8, 2014 (edited) Hello, I've been trying to transplant the Block Newsletter module that's fixed on the footer and I've added the code below to the blocknewsletter.php in the modules folder but no success. public function hookdisplayTop($params) { $this->hookDisplayHome($params); } Thank you Edited October 8, 2014 by Hyperion_ (see edit history) Link to comment Share on other sites More sharing options...
cristic Posted October 8, 2014 Share Posted October 8, 2014 If you go to Module Positions - does Block Newsletter shows under displayTop group? If not, add it there, now that you created the function hookDisplayTop. 1 Link to comment Share on other sites More sharing options...
Hyperion_ Posted October 8, 2014 Author Share Posted October 8, 2014 If you go to Module Positions - does Block Newsletter shows under displayTop group? If not, add it there, now that you created the function hookDisplayTop. Thank you but how do I add it there? Don't I have to transplant it to displayTop? If so, it still doesn't work. It's in actionCustomerAccountAdd and if I do unhook it goes to another groups and eventually ends up in the Footer group. This is how I have the rest of the code: public function hookDisplayLeftColumn($params) { if (!isset($this->prepared) || !$this->prepared) $this->_prepareHook($params); $this->prepared = true; return $this->display(__FILE__, 'blocknewsletter.tpl'); } public function hookFooter($params) { return $this->hookDisplayLeftColumn($params); } public function hookdisplayTop($params) { $this->hookDisplayHome($params); } public function hookdisplayMaintenance($params) { return $this->hookDisplayLeftColumn($params); } public function hookDisplayHeader($params) { $this->context->controller->addCSS($this->_path.'blocknewsletter.css', 'all'); $this->context->controller->addJS($this->_path.'blocknewsletter.js'); } Thank you. Link to comment Share on other sites More sharing options...
cristic Posted October 8, 2014 Share Posted October 8, 2014 I see that you are calling public function hookdisplayTop($params) { $this->hookDisplayHome($params); } But don't know what is in your hookDisplayHome. Try a simple test: public function hookdisplayTop($params) { // $this->hookDisplayHome($params); ddd('hookdisplayTop should work'); } Clear cache, enable _PS_MODE_DEV_ and reload the page. If it shows a blank page with hookdisplayTop should work then it should . Check further in hookDisplayHome. 1 Link to comment Share on other sites More sharing options...
Hyperion_ Posted October 8, 2014 Author Share Posted October 8, 2014 I see that you are calling public function hookdisplayTop($params) { $this->hookDisplayHome($params); } But don't know what is in your hookDisplayHome. Try a simple test: public function hookdisplayTop($params) { // $this->hookDisplayHome($params); ddd('hookdisplayTop should work'); } Clear cache, enable _PS_MODE_DEV_ and reload the page. If it shows a blank page with hookdisplayTop should work then it should . Check further in hookDisplayHome. Just enabled _PS_MODE_DEV_ in the defines.inc.php. The test didn't work so I guess the function is not achieving anything. Where do I get more info from hookDisplayHome? I just really copied the code from vekia in some other topic. Thank you! Link to comment Share on other sites More sharing options...
cristic Posted October 8, 2014 Share Posted October 8, 2014 Just enabled _PS_MODE_DEV_ in the defines.inc.php. The test didn't work so I guess the function is not achieving anything. Where do I get more info from hookDisplayHome? I just really copied the code from vekia in some other topic. Thank you! No, this means that the module is not transplanted to displayTop. Go to Module > Positions > Transplant a module; Select your module from Module drop-down and displayTop (Top of pages) for Hook into. See that you don't have any exception selected. Save and check if the module was successfully added to the hook. After that, test again. 1 Link to comment Share on other sites More sharing options...
Hyperion_ Posted October 8, 2014 Author Share Posted October 8, 2014 No, this means that the module is not transplanted to displayTop. Go to Module > Positions > Transplant a module; Select your module from Module drop-down and displayTop (Top of pages) for Hook into. See that you don't have any exception selected. Save and check if the module was successfully added to the hook. After that, test again. Works now. Thank you! It's on the displayTop group but is not being displayed on top. What should I do? Link to comment Share on other sites More sharing options...
cristic Posted October 8, 2014 Share Posted October 8, 2014 What do you have in hookDisplayHome function? 1 Link to comment Share on other sites More sharing options...
Hyperion_ Posted October 8, 2014 Author Share Posted October 8, 2014 What do you have in hookDisplayHome function? That function doesn't exist in the blocknewsletter.php. I think I did the transplant in a wrong way in the first place. Have removed the code that I've initially posted here. Link to comment Share on other sites More sharing options...
cristic Posted October 8, 2014 Share Posted October 8, 2014 Then you should put something like public function hookdisplayTop($params) { $this->hookDisplayLeftColumn($params); } This is to test if it shows on the front page. Then you probably have to make a new tpl file, to be displayed in the header (instead of the left column). And also any other code you require. 1 Link to comment Share on other sites More sharing options...
Hyperion_ Posted October 8, 2014 Author Share Posted October 8, 2014 (edited) Then you should put something like public function hookdisplayTop($params) { $this->hookDisplayLeftColumn($params); } This is to test if it shows on the front page. Then you probably have to make a new tpl file, to be displayed in the header (instead of the left column). And also any other code you require. I've added that. Doesn't show up. Was only showing on the footer and now is not being displayed whatsoever. Edited October 8, 2014 by Hyperion_ (see edit history) 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