sixthmind Posted February 21, 2012 Share Posted February 21, 2012 I have tried to move newsletter block from left column to the footer by using Transplant a module, but it doesn't work. I have discovered some modules cannot be transplanted to other locations for specific reasons. I went into blocknewsletter.php and added this code at the end before last } : function hookFooter($params) { return $this->hookFooter($params); } What else can I do to move the newsletter block to the footer where it should be? Should php code be different? Link to comment Share on other sites More sharing options...
CartExpert.net Posted February 21, 2012 Share Posted February 21, 2012 Hello, function hookFooter($params) { return $this->hookFooter($params); } This means hookFooter will be executed for 'infinity' as it calling itself without a stop condition. It should return either HTML code or the return value of hookLeftColumn/hookRightColumn. 1 Link to comment Share on other sites More sharing options...
sixthmind Posted February 21, 2012 Author Share Posted February 21, 2012 I followed this instructions: http://www.prestashop.com/forums/topic/51765-solved-re-arranging-module-positions/page__p__549670#entry549670 I don't know what code to put in php file exactly, as I am still learning and trying to understand how everything works. Link to comment Share on other sites More sharing options...
CartExpert.net Posted February 21, 2012 Share Posted February 21, 2012 Hello, this way function hookFooter($params) { return $this->hookLeftColumn($params); } when hookFooter is executed, it will display the same HTML as hookLeftColumn; 2 Link to comment Share on other sites More sharing options...
sixthmind Posted February 21, 2012 Author Share Posted February 21, 2012 Ok I understand now a bit more and I put your code into blocknewsletter.php before last } but I still cannot transplant the newsletter block module to the footer. Link to comment Share on other sites More sharing options...
CartExpert.net Posted February 21, 2012 Share Posted February 21, 2012 Uninstall module, change $this->registerHook('leftColumn') to $this->registerHook('footer') in install() function and install again. 2 Link to comment Share on other sites More sharing options...
sixthmind Posted February 22, 2012 Author Share Posted February 22, 2012 Ok, what I discovered now: I was changing the code in themes/mytheme/modules/blocknewsletter folder, instead of the root/modules folder. I now changed the code in root/modules folder and it works fine, but what happens when the prestashop is upgraded to the latest version? Is this code going to be overriden? Thanks so much CartExpert.net for your time trying to help me with this problem. Link to comment Share on other sites More sharing options...
CartExpert.net Posted February 22, 2012 Share Posted February 22, 2012 Yes, the files will be overwritten. Link to comment Share on other sites More sharing options...
sixthmind Posted February 23, 2012 Author Share Posted February 23, 2012 I found that you can use override folder for changing the core files so when you upgrade to the newest version of PrestaShop, the changes remain. There is a good article about this: http://www.prestashop.com/blog/en/modules_classes_and_controller_override_by_julien_breux/ but I wouldn't know how to apply what they are suggesting in this article to the problem above. Any ideas? Link to comment Share on other sites More sharing options...
CartExpert.net Posted February 23, 2012 Share Posted February 23, 2012 This means: you can create 'copy' of files which will not be overwritten when you upgrade. These copies also overrule/override the originals. This procedure applies only to Class files, Controller files and the template files of the modules. So, if you change the template file 'blockcategories.tpl' of the 'blockcategories' module, you should copy the modified file to: 'themes/[YOUR_THEME]/modules/blockcategories/' This way even if you update and 'modules/blockcategories/blockcategories.tpl' will be overwritten, the system will still use the override file 'themes/[YOUR_THEME]/modules/blockcategories/blockcategories.tpl' This will not work with blockcategories.php For classes and controllers, you need to copy the modified files to 'overrides/' Link to comment Share on other sites More sharing options...
sixthmind Posted February 24, 2012 Author Share Posted February 24, 2012 Thanks CartExpert.net for your detailed explanation. I am slowly starting to understand how everything works. Link to comment Share on other sites More sharing options...
kirinMissy Posted March 21, 2012 Share Posted March 21, 2012 Hello, this way function hookFooter($params) { return $this->hookLeftColumn($params); } when hookFooter is executed, it will display the same HTML as hookLeftColumn; This works for mailchimp module too. Thank you Link to comment Share on other sites More sharing options...
CartExpert.net Posted March 21, 2012 Share Posted March 21, 2012 This works for mailchimp module too. Thank you Happy we could help with this! Link to comment Share on other sites More sharing options...
AndyLaci Posted March 11, 2013 Share Posted March 11, 2013 can you please send me the working footer friendly module complete, I tried to reinstall it few times and it just work with hook header. If I set the function hookFooter($params) { return $this->hookLeftColumn($params); } and also rewrite the hook header and then I get blank page, just with html and body tags, tried to reinstall few more times and still the same porblem, using prestashop 1.5.3 Link to comment Share on other sites More sharing options...
AndyLaci Posted March 12, 2013 Share Posted March 12, 2013 (edited) solved for me: I writed the function with exact $params --> function hookFooter($params) { $this->_prepareHook($params); return $this->display(__FILE__, 'blocknewsletter.tpl'); } Edited March 12, 2013 by AndyLaci (see edit history) 1 Link to comment Share on other sites More sharing options...
AndyLaci Posted March 12, 2013 Share Posted March 12, 2013 (edited) other problem, I want to assign css from theme/css/modules folder, but when I add function public function hookDisplayFooter($params) { $this->context->controller->addCSS($this->_path.'blocknewsletter.css', 'all'); } Is stops showing the footer block and recolor(css) the left column block. /********************************************SOLVED********************************************/ public function hookFooter($params) { $this->_prepareHook($params); $this->context->controller->addCSS($this->_path.'blocknewsletter.css', 'all'); return $this->display(__FILE__, 'blocknewsletter.tpl'); } and removing the previous function Edited March 12, 2013 by AndyLaci (see edit history) 1 Link to comment Share on other sites More sharing options...
jasonwinley Posted May 2, 2013 Share Posted May 2, 2013 (edited) Tried this exactly, and its not working! last few lines of blocknewsletter.php cart 1.5.4.1 http://lucas.lovemywall.co.uk/index.php public function hookDisplayLeftColumn($params) { $this->_prepareHook($params); return $this->display(__FILE__, 'blocknewsletter.tpl'); } public function hookFooter($params) { return $this->hookDisplayLeftColumn($params); } public function hookDisplayHeader($params) { $this->context->controller->addCSS($this->_path.'blocknewsletter.css', 'all'); } public function hookFooter($params) { $this->_prepareHook($params); $this->context->controller->addCSS($this->_path.'blocknewsletter.css', 'all'); return $this->display(__FILE__, 'blocknewsletter.tpl'); } } } Edited May 2, 2013 by jasonwinley (see edit history) Link to comment Share on other sites More sharing options...
Rosie Posy Posted October 15, 2014 Share Posted October 15, 2014 Hi guys The newsletter block has insererted itself in the top of the screen and in the footer. www.rosieposy.fr/en I have disabled the search bar and now the 'newsletter' title is above the catagories in top menu, and the bar for filling customer emails is under the catagories . Any ideas how to rectify this. Also I have the newsletter in the footer and I don't want the newsletter in the footer. Thanks for any advice. Keep well bye for now, Len 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