Thursday, January 5, 2012

Magento get the current URL and Name of category

Magneto registry make it easier to get the current category name and category url
The registry object we are interested in is ‘current_category’ and utilise the registry call getName() to create call to retrieve the needed information.

Category Name: Mage::registry('current_category')->getName();

Category URL: Mage::registry('current_category')->getUrl();

No comments:

Post a Comment

Thankyou for your Comments

LinkWithin

Blog has moved, searching new blog...