You have no items in your shopping cart.
Subtotal: $0.00
You have no items in your shopping cart.
Getting URL of a current page you are visiting or working on is a common requirement in any web development project. There are various ways you can get the current URL of a page in Magento. Here are some :-
From Mage_Core_Helper_Url class
$currentUrl = Mage::helper('core/url')->getCurrentUrl();
From Mage_Core_Model_Store class
If you want to get the root URL of your Magento shop then you can use the following code:
Another way to get current url