Skip to content
This repository has been archived by the owner on Dec 1, 2020. It is now read-only.

[*] blockcategories: assing current starting category to template #12

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion blockcategories.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
2 changes: 1 addition & 1 deletion blockcategories.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
{if $blockCategTree && $blockCategTree.children|@count}
<!-- Block categories module -->
<div id="categories_block_left" class="block">
<h4 class="title_block">{if isset($currentCategory)}{$currentCategory->name|escape}{else}{l s='Categories' mod='blockcategories'}{/if}</h4>
<h4 class="title_block">{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*}</h4>
<div class="block_content">
<ul class="tree {if $isDhtml}dhtml{/if}">
{foreach from=$blockCategTree.children item=child name=blockCategTree}
Expand Down