Magento : Get Current Category – Category Id

9
58
views
Advertisement

$layer = Mage::getSingleton(‘catalog/layer’);
$_category = $layer->getCurrentCategory();
$currentCategoryId= $_category->getId();

Mayank Zalavadia

9 COMMENTS

  1. Thanks Mayank Zalavadia, Your way to get the cat id is the only one that worked for me in the head.phtml file for Magento 1.7. It is a little frustrating to have such a hard time getting something like this to work in your template.