Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save DevertNet/175525e970a5025f7a53 to your computer and use it in GitHub Desktop.
Save DevertNet/175525e970a5025f7a53 to your computer and use it in GitHub Desktop.
Magento How to get the customer login, logout, register and checkout urls
login url
<?php echo Mage::getUrl('customer/account/login'); ?>
logout url
<?php echo Mage::getUrl('customer/account/logout'); ?>
My Account url
<?php echo Mage::getUrl('customer/account'); ?>
Register url
<?php echo Mage::getUrl('customer/account/create'); ?>
Checkout url
<?php echo Mage::getUrl('checkout/cart'); ?>
To get SKIN URL
{{skin url='images/sampleimage.jpg'}}
To get Media URL
{{media url='/sampleimage.jpg'}}
To get Store URL
{{store url='mypage.html'}}
{{store url="page_identifier_here"}}#something
To get Base URL
{{base url=”}}
TO Retrieve URL path in PHTML
Not secure Skin URL
<?php echo $this->getSkinUrl('images/sampleimage.jpg') ?>
Secure Skin URL
<?php echo $this->getSkinUrl('images/ sampleimage.gif',array('_secure'=>true)) ?>
Get Current URL
<?php $current_url = Mage::helper('core/url')->getCurrentUrl();?>
Get Home URL
<?php $home_url = Mage::helper('core/url')->getHomeUrl();?>
Get Magento Media Url
<?php Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK);?>
<?php Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA);?>
Get Magento Skin Url
<?php Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN);?>
Get Magento Store Url
<?php Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);?>
Get Magento Js Url
<?php Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_JS);?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment