本文整理汇总了PHP中Mage_Core_Model_App::getGroup方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Core_Model_App::getGroup方法的具体用法?PHP Mage_Core_Model_App::getGroup怎么用?PHP Mage_Core_Model_App::getGroup使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mage_Core_Model_App
的用法示例。
在下文中一共展示了Mage_Core_Model_App::getGroup方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getDefaultCurrency
/**
* Retrieve default currency for selected store, website or website group
*
* @param Mage_Core_Controller_Request_Http $request
* @return string
*/
public function getDefaultCurrency(Mage_Core_Controller_Request_Http $request)
{
if ($request->getParam('store')) {
$store = $request->getParam('store');
$currencyCode = $this->_app->getStore($store)->getBaseCurrencyCode();
} else {
if ($request->getParam('website')) {
$website = $request->getParam('website');
$currencyCode = $this->_app->getWebsite($website)->getBaseCurrencyCode();
} else {
if ($request->getParam('group')) {
$group = $request->getParam('group');
$currencyCode = $this->_app->getGroup($group)->getWebsite()->getBaseCurrencyCode();
} else {
$currencyCode = $this->_app->getStore()->getBaseCurrencyCode();
}
}
}
return $currencyCode;
}
示例2: getStores
/**
* Get store views for specified store group
*
* @param Mage_Core_Model_Store_Group|int $group
* @return array
*/
public function getStores($group)
{
if (!$group instanceof Mage_Core_Model_Store_Group) {
$group = $this->_application->getGroup($group);
}
$stores = $group->getStores();
if ($storeIds = $this->getStoreIds()) {
foreach ($stores as $storeId => $store) {
if (!in_array($storeId, $storeIds)) {
unset($stores[$storeId]);
}
}
}
return $stores;
}
示例3: testGetGroupNonExisting
/**
* @expectedException Mage_Core_Exception
*/
public function testGetGroupNonExisting()
{
$this->assertNotEmpty($this->_mageModel->getGroup()->getId());
$this->_mageModel->getGroup(100);
}