Get the current category name on your current product/product detail page in Magento.
1 2 3 4 5 6 7 8 |
$categoryIds = $_product->getCategoryIds(); if(count($categoryIds) ){ $firstCategoryId = $categoryIds[0]; $_category = Mage::getModel('catalog/category')->load($firstCategoryId); echo $_category->getName(); } |
Change [0] to [1] to get the 1st child level category.