當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Store::getConfig方法代碼示例

本文整理匯總了PHP中Magento\Store\Model\Store::getConfig方法的典型用法代碼示例。如果您正苦於以下問題:PHP Store::getConfig方法的具體用法?PHP Store::getConfig怎麽用?PHP Store::getConfig使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Magento\Store\Model\Store的用法示例。


在下文中一共展示了Store::getConfig方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getStoreInformationObject

 /**
  * Retrieve generic object with all the misc store information values
  *
  * @param Store $store
  * @return DataObject
  */
 public function getStoreInformationObject(Store $store)
 {
     $info = new DataObject(['name' => $store->getConfig(self::XML_PATH_STORE_INFO_NAME), 'phone' => $store->getConfig(self::XML_PATH_STORE_INFO_PHONE), 'hours' => $store->getConfig(self::XML_PATH_STORE_INFO_HOURS), 'street_line1' => $store->getConfig(self::XML_PATH_STORE_INFO_STREET_LINE1), 'street_line2' => $store->getConfig(self::XML_PATH_STORE_INFO_STREET_LINE2), 'city' => $store->getConfig(self::XML_PATH_STORE_INFO_CITY), 'postcode' => $store->getConfig(self::XML_PATH_STORE_INFO_POSTCODE), 'region_id' => $store->getConfig(self::XML_PATH_STORE_INFO_REGION_CODE), 'country_id' => $store->getConfig(self::XML_PATH_STORE_INFO_COUNTRY_CODE), 'vat_number' => $store->getConfig(self::XML_PATH_STORE_INFO_VAT_NUMBER)]);
     if ($info->getRegionId()) {
         $info->setRegion($this->regionFactory->create()->load($info->getRegionId())->getName());
     }
     if ($info->getCountryId()) {
         $info->setCountry($this->countryFactory->create()->loadByCode($info->getCountryId())->getName());
     }
     return $info;
 }
開發者ID:kidaa30,項目名稱:magento2-platformsh,代碼行數:17,代碼來源:Information.php

示例2: getConfig

 /**
  * {@inheritdoc}
  */
 public function getConfig($path)
 {
     $pluginInfo = $this->pluginList->getNext($this->subjectType, 'getConfig');
     if (!$pluginInfo) {
         return parent::getConfig($path);
     } else {
         return $this->___callPlugins('getConfig', func_get_args(), $pluginInfo);
     }
 }
開發者ID:HaonanXu,項目名稱:der-snack-backup,代碼行數:12,代碼來源:Interceptor.php

示例3: getConfig

 public function getConfig($path)
 {
     if ($this->isDeveloper) {
         switch ($path) {
             case Store::XML_PATH_SECURE_IN_FRONTEND:
             case Store::XML_PATH_SECURE_IN_ADMINHTML:
                 return null;
         }
     }
     return parent::getConfig($path);
 }
開發者ID:outeredge,項目名稱:edge-magento-module-base,代碼行數:11,代碼來源:Store.php

示例4: build

 /**
  * @param Store $store
  * @return \NostoBilling
  */
 public function build(Store $store)
 {
     $metaData = new \NostoBilling();
     try {
         $country = $store->getConfig('general/country/default');
         if (!empty($country)) {
             $metaData->setCountry(new \NostoCountryCode($country));
         }
     } catch (\NostoException $e) {
         $this->_logger->error($e, ['exception' => $e]);
     }
     return $metaData;
 }
開發者ID:Nosto,項目名稱:nosto-magento2,代碼行數:17,代碼來源:Builder.php

示例5: build

 /**
  * @param Store $store
  * @return \NostoAccount
  */
 public function build(Store $store)
 {
     $metaData = new \NostoAccount();
     try {
         $metaData->setTitle(implode(' - ', [$store->getWebsite()->getName(), $store->getGroup()->getName(), $store->getName()]));
         $metaData->setName(substr(sha1(rand()), 0, 8));
         $metaData->setFrontPageUrl(\NostoHttpRequest::replaceQueryParamInUrl('___store', $store->getCode(), $store->getBaseUrl(UrlInterface::URL_TYPE_WEB)));
         $metaData->setCurrency(new \NostoCurrencyCode($store->getBaseCurrencyCode()));
         $lang = substr($store->getConfig('general/locale/code'), 0, 2);
         $metaData->setLanguage(new \NostoLanguageCode($lang));
         $lang = substr($this->_localeResolver->getLocale(), 0, 2);
         $metaData->setOwnerLanguage(new \NostoLanguageCode($lang));
         $owner = $this->_accountOwnerMetaBuilder->build();
         $metaData->setOwner($owner);
         $billing = $this->_accountBillingMetaBuilder->build($store);
         $metaData->setBilling($billing);
     } catch (\NostoException $e) {
         $this->_logger->error($e, ['exception' => $e]);
     }
     return $metaData;
 }
開發者ID:Nosto,項目名稱:nosto-magento2,代碼行數:25,代碼來源:Builder.php

示例6: findAccount

 /**
  * Returns the account with associated api tokens for the store.
  *
  * @param Store $store the store.
  *
  * @return \NostoAccount|null the account or null if not found.
  */
 public function findAccount(Store $store)
 {
     $accountName = $store->getConfig(self::XML_PATH_ACCOUNT);
     if (!empty($accountName)) {
         $account = new \NostoAccount($accountName);
         $tokens = json_decode($store->getConfig(self::XML_PATH_TOKENS), true);
         if (is_array($tokens) && !empty($tokens)) {
             foreach ($tokens as $name => $value) {
                 try {
                     $account->addApiToken(new \NostoApiToken($name, $value));
                 } catch (\NostoInvalidArgumentException $e) {
                 }
             }
         }
         return $account;
     }
     return null;
 }
開發者ID:Nosto,項目名稱:nosto-magento2,代碼行數:25,代碼來源:Account.php


注:本文中的Magento\Store\Model\Store::getConfig方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。