Jump to content
mikias

PS 1.7.1.0 Category Tree / display current category for item

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!

 

 

Share this post


Link to post
Share on other sites

You mean like the module Category tree links on the category page to have it on the product page?

Share this post


Link to post
Share on other sites

Yes. But on product page Category tree should be expanded to current product category. Also there should be shown others categories - whole three.

 

it possible?

Edited by mikias (see edit history)

Share this post


Link to post
Share on other sites

I also look for a solution. Have you already found it ??

Share this post


Link to post
Share on other sites

Thanks for the reply. 
Maybe you want to give your website name, so I can have a look.

Share this post


Link to post
Share on other sites

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)

Share this post


Link to post
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

×

Important Information

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