Magento : Get Store Id, website Id, website info

After hours of searching on Google, i find out some ways to get Store and Website info 🙂

Get current store:


Get current store Id:


Get current website Id:

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

Mage::getModel(‘core/store’)->load( $storeId )->getWebsiteId();

Get store info by store code:

$storeCode = “your_store_code”;


Mage::getModel( “core/store” )->load( $storeCode );

Get website info by website code:

$websiteCode = “your_website_code”;


Mage::getModel( “core/website” )->load( $websiteCode );

Get all stores:


Happy coding :)….


No comments yet.

Leave a Reply