Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $cat = $_product->getCategoryIds();
- $name= Mage::getModel('catalog/category')->load( end($cat) )->getName();
- $categoryIds = $product->getCategoryIds();
- $collection = Mage::getModel('catalog/category')->getCollection()
- ->addAttributeToSelect('name')
- ->addAttributeToFilter('entity_id', $categoryIds)
- ->addAttributeToFilter('is_active', 1);
- $collection->getSelect()->order('level DESC')->limit(1);
- $name = $collection->getFirstItem()->getName();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement