Jump to content

Get root/home level from nested subcategory


feathersanddown

Recommended Posts

Hi, is there a way to get home\root level category from a sub-sub-sub-sub-....-sub-category ?

 

What I need to do is keep track of wich home-level category the user is when exploring sub...sub-categories because home level categories list is in header and visually have a custom icon when user is diving inside selected category. I avoid override Category class.

 

I know that recursively get parent have time cost but I think that this situation should be already created somewhere, right ?

 

I'm newbie with PS and I'm migrating a custom artisan ecommerce solution to PS 1.5. Custom header is a requirement.

 

From this:

 

1

-a

--I

--II

--III

-b

--IV

--V

---i)

---ii)

--VI

-c

2

-e

--VIII

-f

--IX

--X

---iii)

---iv)

g-

 

given "ii)" sub-....-sub-category get category "1" (home level)

 

is possible?? with a trick?

 

Thanks in advance.

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