Loading…

How we can get current url in Magento?

To retrieve the current URL path in Magento, use the below-given syntax at first.

Example

                                        

$currentUrl = Mage::helper('core/url')->getCurrentUrl();
$url = Mage::getSingleton('core/url')->parseUrl($currentUrl);
$path = $url->getPath();

Suggest An Answer

No suggestions avaliable!

Latest post from Magento Interview Questions

Ask Question