Gomlers Posted August 19, 2014 Share Posted August 19, 2014 I would like to put this area on product-page and category-page: I understand there are three different modules used here, but how can I position them above the footer on the other pages I mentioned? The transplant a module doesn't let me transplant any of the modules where I want them.. Link to comment Share on other sites More sharing options...
NemoPS Posted August 20, 2014 Share Posted August 20, 2014 That is the CMS information block It can only hook to the homepage by default, so you need to clone/call this method to other hooks if you want it to appear in other pages public function hookHome($params) { $this->context->controller->addCSS($this->_path.'style.css', 'all'); if (!$this->isCached('blockcmsinfo.tpl', $this->getCacheId())) { $infos = $this->getListContent($this->context->language->id, $this->context->shop->id); $this->context->smarty->assign(array('infos' => $infos, 'nbblocks' => count($infos))); } return $this->display(__FILE__, 'blockcmsinfo.tpl', $this->getCacheId()); } Like public function hookFooterProduct($params) { return $this->hookHome($params); } Link to comment Share on other sites More sharing options...
Gomlers Posted August 21, 2014 Author Share Posted August 21, 2014 (edited) Thank you! Can you tell me which files I should look up? I tried this in the blockcmsinfo.php: public function hookHome($params) { $this->context->controller->addCSS($this->_path.'style.css', 'all'); if (!$this->isCached('blockcmsinfo.tpl', $this->getCacheId())) { $infos = $this->getListContent($this->context->language->id, $this->context->shop->id); $this->context->smarty->assign(array('infos' => $infos, 'nbblocks' => count($infos))); } return $this->display(__FILE__, 'blockcmsinfo.tpl', $this->getCacheId()); } public function hookFooterProducts($params) { return $this->hookHome($params); } And then go to admin->modules->transplant a module, and put the CMS Info Block into displayFooterProduct.. But no luck What did I do wrong? Edited August 21, 2014 by Gomlers (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted August 21, 2014 Share Posted August 21, 2014 Thank you! Can you tell me which files I should look up? I tried this in the blockcmsinfo.php: public function hookHome($params) { $this->context->controller->addCSS($this->_path.'style.css', 'all'); if (!$this->isCached('blockcmsinfo.tpl', $this->getCacheId())) { $infos = $this->getListContent($this->context->language->id, $this->context->shop->id); $this->context->smarty->assign(array('infos' => $infos, 'nbblocks' => count($infos))); } return $this->display(__FILE__, 'blockcmsinfo.tpl', $this->getCacheId()); } public function hookFooterProducts($params) { return $this->hookHome($params); } And then go to admin->modules->transplant a module, and put the CMS Info Block into displayFooterProduct.. But no luck What did I do wrong? displayFooterProduct is not displayFooter hook :-) select correct hook Link to comment Share on other sites More sharing options...
Gomlers Posted August 21, 2014 Author Share Posted August 21, 2014 ugh! Thank you - allthough, I still can't get this to work. 1. I made changes to the file blockcmsinfo.php in modules/blockcmsinfo as in my previous post 2. I'm now trying this: Link to comment Share on other sites More sharing options...
NemoPS Posted August 22, 2014 Share Posted August 22, 2014 You wrote footerProductS, get rid of the S and hook it to displayFooterProduct (not footer, as vekia already pointed out) Link to comment Share on other sites More sharing options...
vekia Posted August 22, 2014 Share Posted August 22, 2014 but displayFooter appears everywhere displayProductFooter only on product page im confused now where you want to display this block? only on product page? or EVERYWHERE but in footer ? Link to comment Share on other sites More sharing options...
NemoPS Posted August 22, 2014 Share Posted August 22, 2014 Well in product and category he said, but for category he needs a custom one. Otherwise it will be shown 2 times in the home, by using displayFooter Link to comment Share on other sites More sharing options...
Gomlers Posted August 22, 2014 Author Share Posted August 22, 2014 Ok - now I am a little confused I tried removing the s as you said Nemo1, and then hook it to displayFooterProduct. This still didn't work. So I tried changing the code into this instead: public function hookFooter($params) { return $this->hookHome($params); } And then I hooked the module into displayFooter This worked - but the result came out like this: What I actually want, is to have the facebook-block and the cms-info-block on every page at the bottom - just as it is on the homepage of the default 1.6-theme. And then I can use the transplant tool, to remove it from the checkout/shoppingcart and other pages I don't want it to show. I believe it should be above the footer when I understand how the footer-hooks works. My apologize for not beeing more spesific. Still appreciating your help though Link to comment Share on other sites More sharing options...
NemoPS Posted August 22, 2014 Share Posted August 22, 2014 As I said, that is the result you get by hooking to the overall footer If you weant to get something similar as aboce, you need to hook above the footer. You might also want to try adding a new hook right above it, as described here, and unhook the cms info block from home: http://nemops.com/adding-hooks-to-prestashop-1-5/#.U_cUmfna6r0 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