Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thagxt/11213234 to your computer and use it in GitHub Desktop.
Save thagxt/11213234 to your computer and use it in GitHub Desktop.
How to Get the Base Url for a specific Magento Store View
<?php
/*
+ If you want, you can set manually the '$storeId' with the number (id) of the desired store.
+ You can also change 'Mage_Core_Model_Store::URL_TYPE_LINK' with one of these:
- Mage_Core_Model_Store::URL_TYPE_JS
- Mage_Core_Model_Store::URL_TYPE_LINK
- Mage_Core_Model_Store::URL_TYPE_MEDIA
- Mage_Core_Model_Store::URL_TYPE_SKIN
- Mage_Core_Model_Store::URL_TYPE_WEB
*/
?>
<?php echo Mage::app()->getStore($storeId)->getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK); ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment