BMGMartin Posted July 20, 2015 Share Posted July 20, 2015 Hello, I've downloaded and installed Prestashop 1.6.1.0 on my localhost. I've been trying to create a new hook, but without any luck. I've been following this tutorial http://nemops.com/adding-hooks-to-prestashop-1-5/#.Va0NPfntlBc I'm using the default preinstalled template. 1 C:\xampp\htdocs\Eshop\themes\default-bootstrap\footer.tpl ....... {if isset($HOOK_FOOTER)} {hook h='beforeFooter'} <!-- new code --> <!-- Footer --> <div class="footer-container"> <footer id="footer" class="container"> ....... 2 C:\xampp\htdocs\Eshop\modules\homeslider\homeslider.php ......... public function install() { /* Adds Module */ if (parent::install() && $this->registerHook('displayHeader') && $this->registerHook('displayTopColumn') && $this->registerHook('actionShopDataDuplication') && $this->registerHook('beforeFooter') /* new code */ ) { ........ and at the end of the file .............. public function hookBeforeFooter($params) { return 'hi there!'; } } ******************* Where is the problem? Nothing shows up on the page and there isn't a new entry in the ps_hook in the database either. I've tried to add the hook into the db manually, but it had no effect. Anyone knows what could be wrong? Link to comment Share on other sites More sharing options...
justandi Posted September 21, 2015 Share Posted September 21, 2015 **BUMP** , i had the same issue .. anyone? Link to comment Share on other sites More sharing options...
thanhvk Posted September 22, 2015 Share Posted September 22, 2015 (edited) Hi there, I seen same issue and this my way resolved it: rename public function hookBeforeFooter($params) to public function hookbeforeFooter($params) in DB find ps_hook table go to the end check beforeFooter created? clear cache, from admin backend go to Advanced Parameters > Performance click "Clear cache" button on top right corner. in Smarty section choose Recompile templates if the files have been updated I use prestashop 1.6.1.1 (you can try steps: 1, 3, 4 before). Good luck! Edited September 23, 2015 by thanhvk (see edit history) 1 Link to comment Share on other sites More sharing options...
justandi Posted October 1, 2015 Share Posted October 1, 2015 @thankvk : i disabled my cache ,not using cache at all and still not working are you sure ,you already try with 1.6.1.x ? Link to comment Share on other sites More sharing options...
yaniv14 Posted October 1, 2015 Share Posted October 1, 2015 Make sure you have the hook installed and positioned in the correct hook. If not you will need to reinstall the module. If its positioned in the new hook just call the hook in the template in a clean area (not inside any if statement). 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