Magento Store Urls – How to get Magento Store URLs programmatically

Thursday, 4. August 2011

Here is how to programmatically get some of the most common URLs for Magento store when developing with Magento

Magento Javascript Folder

Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_JS);
http://magesite.com/js/

Magento Index Page

Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK);
http://magesite.com/index.php/

Magento Media Folder

Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA);
http://magesite.com/media/

Magento Skin Folder

Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN);
http://magesite.com/skin/

Magento Root

Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);
http://magesite.com/

Magento Current Theme Folder

$this->getSkinUrl(”)
Returns something similar to: http://magesite.com/skin/frontend/default/default/current_theme/

Leave a Reply

You must be logged in to post a comment.