Tuesday, May 22, 2012

Get catagory name from product id in cart page

          echo Mage::getModel('catalog/category')->load($this->getProduct()->
getCategoryIds($_item->getProductId()))->getName();



This is the code to get category name in cart page

5 comments:

  1. Bang On.....Great works like charm on magento 1.7.2 Community...Many Thanks.


    Niranjan

    ReplyDelete
  2. This comment has been removed by the author.

    ReplyDelete
  3. Hellow frnds use this code

    helper('catalog/output');
    $_category_detail=Mage::registry('current_category');
    echo $_category_detail->getName(); //gives current category name
    echo $_category_detail->getId(); //gives current category id
    ?>

    ReplyDelete