LIGHT
LIGHT

Reputation: 5712

Get store name in magento using php

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

Answers (2)

LIGHT
LIGHT

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

Roman Snitko
Roman Snitko

Reputation: 3655

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

$code = Mage::app()->getStore()->getCode();

Upvotes: 6

Related Questions