Last active
September 23, 2019 14:09
-
-
Save mukundthanki/3985082 to your computer and use it in GitHub Desktop.
Magento: How to get current category in magento
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Using singleton | |
$_category = Mage::getSingleton('catalog/layer')->getCurrentCategory(); | |
// Using Model | |
$_category = Mage::getModel('catalog/layer')->getCurrentCategory(); | |
// Using Registry | |
$_category = Mage::registry('current_category'); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment