View Single Post
  #3  
Old 03-19-2015, 07:24 AM
 
xgarb xgarb is offline
 

eXpert
  
Join Date: Jul 2004
Location: UK
Posts: 263
 

Default Re: x5 Navigating category tree

Hi,

No.. I wanted every sub-category page to have the top level categories for that area at the top.

I worked out one way of getting the top level category (moving up the tree). It might not be the best way but it works...

Code:
/** * xgarb - Find root cat by going through the path and taking the first result * */ protected function xgarbFindRoot() { $result = array(); foreach ($this->getCategoryPath() as $category) { $result[] = $category->getID(); } return $result[0]; }
__________________
Core version: 5.5.xx
Reply With Quote