From 5b364eb1a7cb1684cd98d2b2b5b29d37995585d8 Mon Sep 17 00:00:00 2001 From: Natrim Date: Tue, 31 Mar 2015 14:27:14 +0200 Subject: [PATCH] [*] blockcategories: assing current starting category to template --- blockcategories.php | 2 +- blockcategories.tpl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/blockcategories.php b/blockcategories.php index 5a9f524..fa2af1c 100644 --- a/blockcategories.php +++ b/blockcategories.php @@ -230,7 +230,7 @@ public function hookLeftColumn($params) } $blockCategTree = $this->getTree($resultParents, $resultIds, $maxdepth, ($category ? $category->id : null)); - $this->smarty->assign('blockCategTree', $blockCategTree); + $this->smarty->assign(array('blockCategTree' => $blockCategTree, 'startingCategory' => $category)); if ((Tools::getValue('id_product') || Tools::getValue('id_category')) && isset($this->context->cookie->last_visited_category) && $this->context->cookie->last_visited_category) { diff --git a/blockcategories.tpl b/blockcategories.tpl index 3331d85..8c149a1 100644 --- a/blockcategories.tpl +++ b/blockcategories.tpl @@ -25,7 +25,7 @@ {if $blockCategTree && $blockCategTree.children|@count}
-

{if isset($currentCategory)}{$currentCategory->name|escape}{else}{l s='Categories' mod='blockcategories'}{/if}

+

{if isset($currentCategory)}{$currentCategory->name|escape}{else}{l s='Categories' mod='blockcategories'}{/if}{*or you can use $startingCategory which contains top category of outputed tree*}

    {foreach from=$blockCategTree.children item=child name=blockCategTree}