Thursday, 6 October 2016

How to get base url of for multi-store ( Js, Media, skin, web etc.)


First you need to know your store id. To get the store id you can use,

$storeId = Mage::app()->getStore()->getStoreId();

Then, you can easily get the  store, Js, Media, skin, web etc.  Here is the full list,


Mage::app()->getStore($storeId)->getBaseUrl(Mage_Core_Model_Store::URL_TYPE_JS);
Mage::app()->getStore($storeId)->getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK);
Mage::app()->getStore($storeId)->getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA);
Mage::app()->getStore($storeId)->getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN);
Mage::app()->getStore($storeId)->getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);

1 comment:

  1. I am really happy to say it’s an interesting post to read . I learn new information from your article , you are doing a great job . Keep it up.magento developers

    ReplyDelete