2

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

LIGHT
  • 5,604
  • 10
  • 35
  • 78
  • 2
    http://stackoverflow.com/questions/2713042/how-to-get-store-information-in-magento – Tom Nov 16 '12 at 14:30

2 Answers2

15

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

Community
  • 1
  • 1
LIGHT
  • 5,604
  • 10
  • 35
  • 78
6

This is a store code, you can get it in the following way:

$code = Mage::app()->getStore()->getCode();
Roman Snitko
  • 3,655
  • 24
  • 29