Reputation: 5712
How can I get the store name in magento using php?
For example:
I have two stores in magento:
domain.com/store/jp
domain.com/store/en
How can I get the store name using php? Can you give me the php code line which returns the store name? either jp or en
Upvotes: 2
Views: 14543
Reputation: 5712
Just sharing what I found:
Get store data
Mage::app()->getStore();
Store Home Url
Mage::app()->getStore()->getHomeUrl();
Store code
Mage::app()->getStore()->getCode();
Is Active
Mage::app()->getStore()->getIsActive();
Website Id
Mage::app()->getStore()->getWebsiteId();
Store Name
Mage::app()->getStore()->getName();
Store Id
Mage::app()->getStore()->getStoreId();
© Source: how to get store information in Magento? by @chapagain
Upvotes: 15
Reputation: 3655
This is a store code, you can get it in the following way:
$code = Mage::app()->getStore()->getCode();
Upvotes: 6