Jun 29, 2013
kalpesh

Magento get store information

Magento get store information from any page.

1
$store = Mage::app()->getStore(); //Mage_Core_Model_Store object

Now to get store ID,

1
$storeID = $store->getStoreId();

To get store code,

1
$storeCode = $store->getCode();

To get store Website ID,

1
$websiteID = $store->getWebsiteId();

To get store name,

1
$storeName = $store->getName();

To get Default View store name,

1
$storeName = $store->getFrontendName();

To check if store is active or not,

1
$active = $store->getIsActive();

To get store’s Home URL,

1
$storeHomeURL = $store->getHomeUrl();

If you want to find store’s group name,

1
$storeGroupName = $store->getGroup()->getName();

If you want ADMIN Store information, admin store has ID 0. So, you can get the details of Admin Store like this:

1
$store = Mage::getModel('core/store')->load(0);

and then getting all the information as shown above.

Leave a comment

 

Welcome to my Blog

Kalpesh MehtaHelping Magento developers in their day-to-day development problems since 2011. Most of the problems and solutions here are my own experiences while working on different projects. Enjoy the blog and don't forget to throw comments and likes/+1's/tweets on posts you like. Thanks for visiting!

Certifications

Honor

Recognition

Magento top 50 contributors

Magento top 50 contributors

Contributions