本文整理匯總了PHP中Magento\Store\Model\StoreManagerInterface::getGroup方法的典型用法代碼示例。如果您正苦於以下問題:PHP StoreManagerInterface::getGroup方法的具體用法?PHP StoreManagerInterface::getGroup怎麽用?PHP StoreManagerInterface::getGroup使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Magento\Store\Model\StoreManagerInterface
的用法示例。
在下文中一共展示了StoreManagerInterface::getGroup方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getCurrentStockId
public function getCurrentStockId()
{
$group = $this->_manStore->getGroup();
$id = $group->getId();
$result = isset($this->_mapGroupToStock[$id]) ? $this->_mapGroupToStock[$id] : \Magento\CatalogInventory\Model\Stock::DEFAULT_STOCK_ID;
return $result;
}
示例2: getScope
/**
* {@inheritdoc}
* @throws InitException
*/
public function getScope($scopeId = null)
{
$scope = $this->storeManager->getGroup($scopeId);
if (!$scope instanceof ScopeInterface) {
throw new InitException(__('Invalid scope object'));
}
return $scope;
}
示例3: getRootCategoryId
/**
* Retrieve store root category id.
*
* @param \Magento\Store\Api\Data\StoreInterface|int|string $store Store id.
*
* @return integer
*/
protected function getRootCategoryId($store)
{
if (is_numeric($store) || is_string($store)) {
$store = $this->getStore($store);
}
$storeGroupId = $store->getStoreGroupId();
return $this->storeManager->getGroup($storeGroupId)->getRootCategoryId();
}
示例4: getDefaultCustomerProfile
/**
* @return array
*/
protected function getDefaultCustomerProfile()
{
if (!$this->customerDataProfile) {
$this->customerDataProfile = ['website_id' => $this->storeManager->getWebsite()->getId(), 'group_id' => $this->storeManager->getGroup()->getId(), 'disable_auto_group_change' => '0', 'prefix', 'firstname' => '', 'middlename' => '', 'lastname' => '', 'suffix' => '', 'email' => '', 'dob' => '', 'taxvat' => '', 'gender' => '', 'confirmation' => false, 'sendemail' => false];
}
return $this->customerDataProfile;
}
示例5: _initCollection
/**
* @return void
*/
protected function _initCollection()
{
$isFilter = $this->getParam('store') || $this->getParam('website') || $this->getParam('group');
$this->_collection = $this->_orderCollection->prepareSummary($this->getParam('period'), 0, 0, $isFilter);
if ($this->getParam('store')) {
$this->_collection->addFieldToFilter('store_id', $this->getParam('store'));
} elseif ($this->getParam('website')) {
$storeIds = $this->_storeManager->getWebsite($this->getParam('website'))->getStoreIds();
$this->_collection->addFieldToFilter('store_id', ['in' => implode(',', $storeIds)]);
} elseif ($this->getParam('group')) {
$storeIds = $this->_storeManager->getGroup($this->getParam('group'))->getStoreIds();
$this->_collection->addFieldToFilter('store_id', ['in' => implode(',', $storeIds)]);
} elseif (!$this->_collection->isLive()) {
$this->_collection->addFieldToFilter('store_id', ['eq' => $this->_storeManager->getStore(\Magento\Store\Model\Store::ADMIN_CODE)->getId()]);
}
$this->_collection->load();
}
示例6: 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;
}
示例7: getFallbackScope
/**
* @inheritdoc
*/
public function getFallbackScope($scope, $scopeId, $forConfig = true)
{
if (!isset($this->fallback[$scope][$scopeId][$forConfig])) {
$fallback = [null, null];
switch ($scope) {
case ScopeInterface::SCOPE_WEBSITE:
case ScopeInterface::SCOPE_WEBSITES:
$fallback = [ScopeConfigInterface::SCOPE_TYPE_DEFAULT, null];
break;
case ScopeInterface::SCOPE_GROUP:
$fallback = [ScopeInterface::SCOPE_WEBSITES, $this->storeManager->getGroup($scopeId)->getWebsiteId()];
break;
case ScopeInterface::SCOPE_STORE:
case ScopeInterface::SCOPE_STORES:
$fallback = $forConfig ? [ScopeInterface::SCOPE_WEBSITES, $this->storeManager->getStore($scopeId)->getWebsiteId()] : [ScopeInterface::SCOPE_GROUP, $this->storeManager->getStore($scopeId)->getStoreGroupId()];
}
$this->fallback[$scope][$scopeId][$forConfig] = $fallback;
}
return $this->fallback[$scope][$scopeId][$forConfig];
}