Vertricus Posted April 12, 2013 Posted April 12, 2013 I want to get access to smarty vars in blockcategories.tpl so i have to create hook, but dont know how. (var display in debug console) I create override to CategoryController and use assing method: class CategoryController extends CategoryControllerCore { protected function fun() { /* * Some Code */ $this->context->smarty->assign('mainCatName',$mainCatName); $this->context->smarty->assign('HOOK_LEFT_COLUMN', Module::hookExec('displayLeftColumn')); } } according to this: http://doc.prestashop.com/display/PS15/Diving+into+PrestaShop+Core+development#DivingintoPrestaShopCoredevelopment-Usinghooks it should work or i don't understand it correctly. Share this post Link to post Share on other sites More sharing options...
Alex Simonchik BelVG Posted April 12, 2013 Posted April 12, 2013 Hi, I think it should works, do you have any troubles with this code? Regards Share this post Link to post Share on other sites More sharing options...
Vertricus Posted April 12, 2013 Posted April 12, 2013 Nope, but still dont have access to my vars. Share this post Link to post Share on other sites More sharing options...
Alex Simonchik BelVG Posted April 12, 2013 Posted April 12, 2013 Maybe blockcategories.tpl renders before fun() function? Or Module::hookExec('displayLeftColumn') didn't runs before it? Share this post Link to post Share on other sites More sharing options...
Vertricus Posted April 12, 2013 Posted April 12, 2013 <?php class CategoryController extends CategoryControllerCore { protected function assignSubcategories() { $this->context->smarty->assign('mainCatName',"Test"); $this->context->smarty->assign('HOOK_LEFT_COLUMN', Module::hookExec('displayLeftColumn')); return parent::assignSubcategories(); } } ?> This still doesn't work. i totally have no idea what i doing wrong ;/ Share this post Link to post 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