Warning: Cannot modify header information - headers already sent by (output started at /www/wwwroot/sbboke.com/wp-content/plugins/wordpress-seo/src/integrations/front-end-integration.php:409) in /www/wwwroot/sbboke.com/wp-content/themes/pacify/content-single.php on line 5

在Magento获取商店信息

要从Magento的任何位置获取有关当前商店的信息,请使用:

<?php
$store = Mage::app()->getStore();

这将为您提供一个Mage_Core_Model_Store对象,它具有您需要的一些信息:

<?php
$name = $store->getName();

获取商店数据

Mage::app()->getStore();

商店ID

Mage::app()->getStore()->getStoreId();

商店代码

Mage::app()->getStore()->getCode();

网站ID

Mage::app()->getStore()->getWebsiteId();

商店名称

Mage::app()->getStore()->getName();

存储前端名称

Mage::app()->getStore()->getFrontendName();

活跃

Mage::app()->getStore()->getIsActive();

商店的主页网址

Mage::app()->getStore()->getHomeUrl();

商店的当前页面URL

Mage::app()->getStore()->getCurrentUrl();

所有这些函数都可以在Mage_Core_Model_Store类中找到

文件:app / code / core / Mage / Core / Model / Store.php

相关文章

0 0 投票数
文章评分
订阅评论
提醒
0 评论
内联反馈
查看所有评论