Jump to content

Recommended Posts

I will ask you an important question, which I think will be useful for everyone. I need to modify the code of the "block categories" of prestashop 1.6 (Bootstrap theme) to ensure that all categories are visible even when the user is in a specific category. In fact, if the user enters a specific category, "Block Categories" shows only the category you are viewing. 

According to you, what can I change in the code? 

I am writing it

 


<!-- Block categories module -->

<div id="categories_block_left" class="block">

<h2 class="title_block">

{if isset($currentCategory)}

{$currentCategory->name|escape}

{else}

{l s='Categories' mod='blockcategories'}

{/if}

</h2>

<div class="block_content">

<ul class="tree {if $isDhtml}dhtml{/if}">

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

{if $smarty.foreach.blockCategTree.last}

{include file="$branche_tpl_path" node=$child last='true'}

{else}

{include file="$branche_tpl_path" node=$child}

{/if}

{/foreach}

</ul>

</div>

</div>

<!-- /Block categories module -->

{/if}


 

 

Thanks for your time.

Edited by marcellolaforgia (see edit history)

Share this post


Link to post
Share on other sites

it's not a matter of .tpl file

you have to modify module .php file

comapre code with block categories from 1.5

you will see difference :-)

 

//just remove the:

$from_category = $this->context->cookie->last_visited_category;

  • Like 1

Share this post


Link to post
Share on other sites

it's blockcategories.php

 

As a raw trick comment out this part:

 

if ($phpself != null && in_array($phpself, $current_allowed_controllers) && Configuration::get('BLOCK_CATEG_ROOT_CATEGORY') && isset($this->context->cookie->last_visited_category) && $this->context->cookie->last_visited_category)
$from_category = $this->context->cookie->last_visited_category;
 
Line 192
 
THen you'll have to change the block's name so it doesn't grab the current category name, if you want

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More