robplugandplay Posted March 31, 2011 Share Posted March 31, 2011 Hello,I am currently having difficulty with the homefeatured module.I am attempting to call the homefeatured module in a custom hook called TwocolsFeatured however it seems like homefeatured will only work on the Home hook. Am I writing the wrong code or is there a work around for this?(N. I am using prestashop 1.4The code is as follows:FrontController.php self::$smarty->assign(array( 'HOOK_HEADER' => Module::hookExec('header'), 'HOOK_TOP' => Module::hookExec('top'), 'HOOK_LEFT_COLUMN' => Module::hookExec('leftColumn'), 'HOOK_NEWSLETTER' => Module::hookExec('newsletter'), 'HOOK_TWOCOL_FEATURED' => Module::hookExec('homefeatured'), 'HOOK_THREECOL_FEATURED' => Module::hookExec('homefeatured_bottom') )); HomeFeatured.php function install() { if (!Configuration::updateValue('HOME_FEATURED_NBR', 8) OR !parent::install() OR !$this->registerHook('home') OR !$this->registerHook('twocolFeatured') OR !$this->registerHook('threecolFeatured')) return false; return true; } public function hooktwocolFeatured($params) { echo 'hook twocol'; return $this->hookHome($params); } public function hookThreecolFeatured($params) { global $smarty; $category = new Category(1, Configuration::get('PS_LANG_DEFAULT')); $nb = (int)(Configuration::get('HOME_FEATURED_NBR')); $products = $category->getProducts((int)($params['cookie']->id_lang), 1, ($nb ? $nb : 10)); $smarty->assign(array( 'products' => $products, 'add_prod_display' => Configuration::get('PS_ATTRIBUTE_CATEGORY_DISPLAY'), 'homeSize' => Image::getSize('home_bottom'))); return $this->display(__FILE__, 'homefeatured.tpl'); } } index.tpl ps_hook database entry id_hook name title description position live_edit 68 homefeatured Home Content Featured top left 4 Specials that appear twocols left 1 1 69 homefeatured_bottom Home Featured Products on Bottom Home featured products positioned on bottom 1 1 Thank You for any help that can be offeredMr.Enigma {$HOOK_TWOCOL_FEATURED} <!-- END LEFT --> Link to comment Share on other sites More sharing options...
robplugandplay Posted April 1, 2011 Author Share Posted April 1, 2011 35 views but no one knows the answer? LOLAt least I'm not the only one =] Link to comment Share on other sites More sharing options...
robplugandplay Posted April 4, 2011 Author Share Posted April 4, 2011 Really no one? Link to comment Share on other sites More sharing options...
uddhava Posted May 9, 2011 Share Posted May 9, 2011 I think the mistake is in HomeFeatured.php.You call $this->registerHook('twocolFeatured')But the hook is called homefeatured... 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