kotkotan Posted March 13, 2014 Share Posted March 13, 2014 Hello! Somebody can tell me how create a new hook between footer and homepage (red in screen) and to insert module to this place? Link to comment Share on other sites More sharing options...
vekia Posted March 13, 2014 Share Posted March 13, 2014 for what prestashop version? Link to comment Share on other sites More sharing options...
vekia Posted March 13, 2014 Share Posted March 13, 2014 1) Open PHPMyAdmin. search for your shop database and open it. search for "ps_hook" table and open it. Insert new Row and name it for example displayBeforeFooter . 2) open footer.tpl file and insert this: {Hook::exec('displayBeforeFooter')} right before: <div id="footer" class="grid_9 alpha omega clearfix"> {$HOOK_FOOTER} {if $PS_ALLOW_MOBILE_DEVICE} <p class="center clearBoth"><a href="{$link->getPageLink('index', true)}?mobile_theme_ok">{l s='Browse the mobile site'}</a></p> {/if} </div> 2 Link to comment Share on other sites More sharing options...
kotkotan Posted March 13, 2014 Author Share Posted March 13, 2014 (edited) Presta 1.5.4.1 have done all steps, but module don't want to insert in hook maybe problem in footer.tpl: <!-- Footer --> <div id="footer" class="grid_9 alpha omega clearfix"> {$HOOK_FOOTER} </div> </div> {Hook::exec('displayBeforeFooter')} {/if} </body> </html> it is correct? Edited March 13, 2014 by kotkotan (see edit history) Link to comment Share on other sites More sharing options...
kotkotan Posted March 13, 2014 Author Share Posted March 13, 2014 it works! have add this code to my general php module file (in this case lofnewproduct.php) function hookdisplayBeforeFooter($params) { return $this->hookhome($params, 'displayBeforeFooter'); } and changed footer.tpl to this: {Hook::exec('displayBeforeFooter')} <!-- Footer --> <div id="footer" class="grid_9 alpha omega clearfix"> {$HOOK_FOOTER} </div> </div> {/if} </body> </html> it's works 100% thanks to vekia Link to comment Share on other sites More sharing options...
güncelnet Posted March 13, 2014 Share Posted March 13, 2014 1) Open PHPMyAdmin. search for your shop database and open it. search for "ps_hook" table and open it. Insert new Row and name it for example displayBeforeFooter . 2) open footer.tpl file and insert this: {Hook::exec('displayBeforeFooter')} right before: <div id="footer" class="grid_9 alpha omega clearfix"> {$HOOK_FOOTER} {if $PS_ALLOW_MOBILE_DEVICE} <p class="center clearBoth"><a href="{$link->getPageLink('index', true)}?mobile_theme_ok">{l s='Browse the mobile site'}</a></p> {/if} </div> thanx mod Link to comment Share on other sites More sharing options...
kotkotan Posted March 13, 2014 Author Share Posted March 13, 2014 maybe somebody know how to add to this new hook displayBeforeFooter another module which is coming in default template and called homefeatured this is not working: have add this code to my general php module file (in this case lofnewproduct.php) function hookdisplayBeforeFooter($params) { return $this->hookhome($params, 'displayBeforeFooter'); } Link to comment Share on other sites More sharing options...
vekia Posted March 13, 2014 Share Posted March 13, 2014 you have to modify module code. by default this module dont support this hook. so you have add function to handle it. public function hookdisplayBeforeFooter($params) { return $this->hookhome($params); } Link to comment Share on other sites More sharing options...
kotkotan Posted March 13, 2014 Author Share Posted March 13, 2014 you have to modify module code. by default this module dont support this hook. so you have add function to handle it. public function hookdisplayBeforeFooter($params) { return $this->hookhome($params); } when i've add this code to homefeatured.php and mudule switch on, there are disappears my footer and another module hooked in displayBeforeFooter (previous) Link to comment Share on other sites More sharing options...
vekia Posted March 13, 2014 Share Posted March 13, 2014 my mistake inside function use this: return $this->hookDisplayHome($params); Link to comment Share on other sites More sharing options...
kotkotan Posted March 17, 2014 Author Share Posted March 17, 2014 my mistake inside function use this: return $this->hookDisplayHome($params); full code like this: public function hookdisplayBeforeFooter($params) { return $this->hookDisplayHome($params); } not working. Link to comment Share on other sites More sharing options...
Joshuaadamo Posted April 1, 2014 Share Posted April 1, 2014 (edited) Hello ! Work for my presta 1.5.6 but i have now problem. I use this for hook new module content box from this site http://contentbox.org/ I am getting error "Your text file is empty." wen i edit content of module! Module work good wen is not pushed to newhook by code in file php of module public function hookdisplayBeforeFooter($params) { return $this->hookDisplayHome($params); } Some one help me please! Ok! i install module after adding this code and working good Edited April 7, 2014 by Joshuaadamo (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts