Skip to content

Instantly share code, notes, and snippets.

@mukundthanki
Last active September 23, 2019 14:09
Show Gist options
  • Save mukundthanki/3985082 to your computer and use it in GitHub Desktop.
Save mukundthanki/3985082 to your computer and use it in GitHub Desktop.
Magento: How to get current category in magento
<?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