trsakhilk Posted November 15, 2012 Share Posted November 15, 2012 (edited) Hi guyzz... So i got the banner module to work in the home hook in the index.tpl file.... So what i need is that i need to add this hook to the cms.tpl or any other tpl files for this matter.. I dont want the banner to show in certain pages so is there any way i can do this... I tried adding the {$HOOK_HOME} in the tpl files but it seems this hook works only in the index.tpl page. Please help me out guyzz... Edited November 15, 2012 by trsakhilk (see edit history) Link to comment Share on other sites More sharing options...
Alex Simonchik BelVG Posted November 15, 2012 Share Posted November 15, 2012 Hi, You need to execute the HOME hook in controller: //1.4.x self::$smarty->assign('HOOK_HOME', Module::hookExec('home')); //1.5.x $this->context->smarty->assign('HOOK_HOME', Hook::exec('displayHome')); Regards Link to comment Share on other sites More sharing options...
trsakhilk Posted November 16, 2012 Author Share Posted November 16, 2012 Hi, You need to execute the HOME hook in controller: //1.4.x self::$smarty->assign('HOOK_HOME', Module::hookExec('home')); //1.5.x $this->context->smarty->assign('HOOK_HOME', Hook::exec('displayHome')); Regards Once again you came to my rescue... Thanks a lot...works like a charm... Link to comment Share on other sites More sharing options...
trsakhilk Posted November 16, 2012 Author Share Posted November 16, 2012 By the way how do you add the home hook to the wishlist block.. i want the banner to appear in mywishlist page..if its the same way then in which file do i add the code.. Please i am confused about it... Thanks in advance.. Link to comment Share on other sites More sharing options...
Alex Simonchik BelVG Posted November 16, 2012 Share Posted November 16, 2012 I think that the best way in your case is creating your own hook, instead of hook Home, becose when hook execute it run all modules register in that hook. For cusomize "My wishlist page" you need to edit modules/blockwishlist/mywishlist.php. Regards Link to comment Share on other sites More sharing options...
trsakhilk Posted November 16, 2012 Author Share Posted November 16, 2012 I think that the best way in your case is creating your own hook, instead of hook Home, becose when hook execute it run all modules register in that hook. For cusomize "My wishlist page" you need to edit modules/blockwishlist/mywishlist.php. Regards Thats ok..i am using only a single module in the home hook... Where in mywishlist.php should i add it...is the code different for it?? I tried adding the same code that you mentioned but it did not work... Link to comment Share on other sites More sharing options...
Alex Simonchik BelVG Posted November 20, 2012 Share Posted November 20, 2012 Where in mywishlist.php should i add it...is the code different for it?? I think it must be there (mywishlist.php): if ($context->customer->isLogged()) { ... Also you need to modify (mywishlist.tpl), where you may using {$HOOK_HOME} Link to comment Share on other sites More sharing options...
sujeet Posted December 19, 2012 Share Posted December 19, 2012 (edited) I am New in Prestashop i am created a php file and i want to call the Hook : updateQuantity in that file from my root directory. Edited December 19, 2012 by sujeet (see edit history) Link to comment Share on other sites More sharing options...
Alex Simonchik BelVG Posted December 19, 2012 Share Posted December 19, 2012 (edited) Hi sujeet, you can try it: Hook::exec('actionUpdateQuantity', array( 'id_product' => $id_product, 'id_product_attribute' => $id_product_attribute, 'quantity' => $stock_available->quantity ) ); Regards Edited December 19, 2012 by Alexander Simonchik (see edit history) Link to comment Share on other sites More sharing options...
sujeet Posted December 20, 2012 Share Posted December 20, 2012 Thanks for the reply , i used above code in my script and executed but quantity not updated in database.. Link to comment Share on other sites More sharing options...
Alex Simonchik BelVG Posted December 21, 2012 Share Posted December 21, 2012 The code above isn't the guide to action. I meen that you can using the hookActionUpdateQuantity() in your own module. Link to comment Share on other sites More sharing options...
Recommended Posts