本文整理匯總了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;
}
示例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);
}
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}