【发布时间】:2012-11-16 14:18:49
【问题描述】:
如何使用 php 在 magento 中获取商店名称?
例如:
我在 magento 有两家商店:
domain.com/store/jp
domain.com/store/en
如何使用 php 获取商店名称?你能给我返回商店名称的php代码行吗? jp 或 en
【问题讨论】:
如何使用 php 在 magento 中获取商店名称?
例如:
我在 magento 有两家商店:
domain.com/store/jp
domain.com/store/en
如何使用 php 获取商店名称?你能给我返回商店名称的php代码行吗? jp 或 en
【问题讨论】:
只是分享我的发现:
获取商店数据
Mage::app()->getStore();
商店主页网址
Mage::app()->getStore()->getHomeUrl();
商店代码
Mage::app()->getStore()->getCode();
有效
Mage::app()->getStore()->getIsActive();
网站 ID
Mage::app()->getStore()->getWebsiteId();
商店名称
Mage::app()->getStore()->getName();
商店 ID
Mage::app()->getStore()->getStoreId();
【讨论】:
这是一个商店代码,您可以通过以下方式获取:
$code = Mage::app()->getStore()->getCode();
【讨论】: