I'm building a tree view for my magento site. Its all working fine. But the only problem is that When I go into 4th level categories the URL path of the category is not coming properly.
Lets say I have the following url path
this is my 3rd level category url. The problem is that I would have another sub category under electronic like,
, but magento does not give me this path. it will only give upto the 3rd level category.
This is the code that I am using.
$cat = Mage::getModel('catalog/category')->load($category->getId()); echo Mage::getUrl($cat->getUrlPath());