Jump to content

PS 1.7.1.0 Category Tree / display current category for item


mikias

Recommended Posts

Hello, 

 

I'm looking for solution to view actual (current) category for product item with expand whole tree structure also with rest all menu items colapsed.

 

Im trying some changes in settings module but no results...

 

is there any additional module? or maybe some manual how to do this?

 

thanks in advance for any help!

 

 

Link to comment
Share on other sites

  • 1 month later...
  • 1 year later...

PrestaShop 1.7.x Smooth solution

In case somebody wants to expand Category Tree list in PrestaShop 1.7.X and can't find "aria" tags inside .tpl files.

This worked for me on 1.7.4

1. Locate file "../modules/ps_categorytree/views/templates/hook/ps_categorytree.tpl"

2. Add class "in" so you will get class="collapse in" inside where relevant. You should get something like this:

<div class="collapse in" id="exCollapsingNavbar{$node.id}">
{categories nodes=$node.children depth=$depth+1}
</div>

3. Replace the "ps_categorytree.tpl" on your server and force the memory reload via Advanced Settings. This should open all your category levels in the sidebar.

4. You will see that the "+" and "-" icons are the other way round.

5. In the same file add "{if !$_collapse} aria-expanded="true"{/if}", right after the tag data-target="#exCollapsingNavbar{$node.id}", without spaces. You should get something like this: 

<div class="navbar-toggler collapse-icons" data-toggle="collapse" data-target="#exCollapsingNavbar{$node.id}"{if !$_collapse} aria-expanded="true"{/if}>
<i class="material-icons add"></i>
<i class="material-icons remove"></i>
</div>

6. Save "ps_categorytree.tpl" again, replace on your server, flush memory again and reload your site in Incognito (noCache) mode.

7. Final result with all categories opened attached.

 

Screenshot 2018-12-19 at 20.58.39.png

Edited by ciepolml
More detailed reason of a fix. (see edit history)
Link to comment
Share on other sites

  • 2 years later...
On 12/19/2018 at 9:59 PM, ciepolml said:

PrestaShop 1.7.x Smooth solution



<div class="navbar-toggler collapse-icons" data-toggle="collapse" data-target="#exCollapsingNavbar{$node.id}"{if !$_collapse} aria-expanded="true"{/if}>
<i class="material-icons add"></i>
<i class="material-icons remove"></i>
</div>

Thank you for sharing your solution. 
It's not working for me  - $_collapse variable is not available. Where do you get the value, did you extended php of the module?
 

 

Edited by webplus (see edit history)
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...