Jump to content

Block Category only to show current category from lvl 1, and current and parent category from lvl2


Supermanzo

Recommended Posts

I tried following what is written in this forum to have hints on how to accomplish this:

 

on 1.5.3.1 block categories i'm trying to show only level 1 category and related subcategories

example:

 

home

--shoes

-----runners

-----boots

--clothes

-----shirts

-----pants

 

when i'm inside shoes i want only to see shoes and related subcategories and not clothes or other categories at the same level as shoes. When i'm in a subcategory (lvl2) i want to see only the parent category (lvl1 parent cat (shoes)) and the others subcategory at the same level (lvl2(runner,boots)). Can anyone help me on how to do it?

 

Thanks

Link to comment
Share on other sites

  • 1 month later...

Hi,

In order to block category only to show current category from lv1

 

open file \themes\{THEMEfolder name}\js\tools\treeManagement.js if any theme installed or if defualt theme then open themes\default\js\tools\treeManagement.js

 

Edit function

 

 

function toggleBranch(jQueryElement, noAnimation) {

if(jQueryElement.hasClass('OPEN'))

closeBranch(jQueryElement, noAnimation);

else

openBranch(jQueryElement, noAnimation);

}

 

 

Replaced with

 

 

function toggleBranch(jQueryElement, noAnimation) {

closeBranch($('.OPEN'), noAnimation);

if(jQueryElement.hasClass('OPEN'))

closeBranch(jQueryElement, noAnimation);

else

openBranch(jQueryElement, noAnimation);

}

  • Like 1
Link to comment
Share on other sites

  • 1 month later...
  • 6 months later...

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...