widjayy Posted December 18, 2012 Share Posted December 18, 2012 Dear all, I'm on prestashop 1.5. I experience a problem on creating a hook, and displaying an existing module, homefeatured. I want to place it between the home content (two columns: left colum, center colum) and the footer. I called my hook: superFooter. Here what I done. 1. I created the hook 'superFooter' in the pss_hook table 2. I put the following code in the file /override/classes/FrontController.php for overriding: <?php class FrontController extends FrontControllerCore { public function displayFooter() { self::$smarty->assign(array( 'HOOK_SUPERFOOTER' => Module::hookExec('superfooter') )); return parent::displayFooter(); } } 3. I put the following code at the beginning of my footer.tpl page: {if !$content_only} </div> </div> <div id="superfooter"> {$HOOK_SUPERFOOTER}. </div> <!-- Footer --> I tried too to replace {$HOOK_SUPERFOOTER} by {hook h='superFooter'} 4. I modified the following functions in the homefeatured.php module file: function install() { if (!Configuration::updateValue('HOME_FEATURED_NBR', 8) || !parent::install() || !$this->registerHook('displayHome') || !$this->registerHook('header') || !$this->registerHook('superfooter')) return false; return true; } public function hooksuperfooter($params) { return $this->hookFooter($params); } 5. I transplanted the module to the new superFooter hook in my backoffice portal. And... nothing appeared in my webpage. Am I doing all things alright? Could you help me please? Thanks a lot Link to comment Share on other sites More sharing options...
revert Posted January 14, 2013 Share Posted January 14, 2013 You must create new hook in database: table ps_hook 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