Jump to content

Create display hook


Vertricus

Recommended Posts

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.

Link to comment
Share on other sites

<?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 ;/

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...