You can get current category from the following code:
$currentCategory = Mage::registry('current_category');
You can get the parent category from the following code:
/**
* You want the parent category of a sub-category
* Let the sub-category be $subCategory
*/
$parentCategory = Mage::getModel('catalog/category')->load($subCategory->getParentId());
No comments:
Post a Comment