Get Store and Website information in Magento

By | April 2, 2014

Many a time it requires a programmer to access the store information like store id or store status, store name, website id, website name etc.

These methods will help to fetch the details of the current store and website in Magento.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/*Get Store*/
echo Mage::app()->getStore();

/*Store Id*/
echo Mage::app()->getStore()->getStoreId();

/*Store Name*/
echo Mage::app()->getStore()->getName();

/*Store code*/
echo Mage::app()->getStore()->getCode();

/*Store is Active*/
echo Mage::app()->getStore()->getIsActive();

/*Store Home Url*/
echo Mage::app()->getStore()->getHomeUrl();

/*Website Id*/
echo Mage::app()->getStore()->getWebsiteId();

/*Website Name*/
echo Mage::app()->getStore()->getWebsiteName();

Hope! it will help.

Leave a Reply