How to get category name by product id in magento?
You can get category name by product id by following code. Where You want display category name, put the code.
<?php $product = Mage::getModel('catalog/product')->load($_product->getId());
$cats = $product->getCategoryIds();
foreach($cats as $categoryId) {
$category = Mage::getModel('catalog/category')->load($categoryId);
echo $category->getName();
}
?>
This post is pretty good actually and it has very important information.
ReplyDeleteThank you for this kind of post.
Buy kashmiri neelam online
This post is very important for the magento developer and its very useful code about the category name. Thanks for sharing and keep updating.
ReplyDeleteTransplantation
Really like it, thanks.
ReplyDeleteBariatric Surgery hospital in india
Thanks for this kind of posts, really appreciated.
ReplyDeletejapanese red coral online
omega 3 fatty acids capsules | lycopene capsules | lycopene supplement
ReplyDeleteThis post is really very nice and keep updating.
ReplyDeleteRudraksha mala online
Buy pitambari sapphire online