本文整理汇总了PHP中Magento\Framework\StoreManagerInterface::getGroup方法的典型用法代码示例。如果您正苦于以下问题:PHP StoreManagerInterface::getGroup方法的具体用法?PHP StoreManagerInterface::getGroup怎么用?PHP StoreManagerInterface::getGroup使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Magento\Framework\StoreManagerInterface
的用法示例。
在下文中一共展示了StoreManagerInterface::getGroup方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getDefaultCurrency
/**
* Retrieve default currency for selected store, website or website group
* @todo: Refactor to ScopeDefiner
* @param \Magento\Framework\App\RequestInterface $request
* @return string
*/
public function getDefaultCurrency(\Magento\Framework\App\RequestInterface $request)
{
if ($request->getParam('store')) {
$store = $request->getParam('store');
$currencyCode = $this->_storeManager->getStore($store)->getBaseCurrencyCode();
} else {
if ($request->getParam('website')) {
$website = $request->getParam('website');
$currencyCode = $this->_storeManager->getWebsite($website)->getBaseCurrencyCode();
} else {
if ($request->getParam('group')) {
$group = $request->getParam('group');
$currencyCode = $this->_storeManager->getGroup($group)->getWebsite()->getBaseCurrencyCode();
} else {
$currencyCode = $this->_configuration->getValue(\Magento\Directory\Model\Currency::XML_PATH_CURRENCY_BASE, 'default');
}
}
}
return $currencyCode;
}