Magento – Get the Current Category

0
51
views
Need to get the current category loaded? No problem! Just use this useful little code below. It will return an object of the current category and id of the current category.

Mage::registry('current_category') && Mage::registry('current_category')->getId()