本文整理汇总了PHP中Mage_Core_Model_Store::getConfig方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Core_Model_Store::getConfig方法的具体用法?PHP Mage_Core_Model_Store::getConfig怎么用?PHP Mage_Core_Model_Store::getConfig使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mage_Core_Model_Store
的用法示例。
在下文中一共展示了Mage_Core_Model_Store::getConfig方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testSetGetConfig
public function testSetGetConfig()
{
/* config operations require store to be loaded */
$this->_model->load('default');
$value = $this->_model->getConfig(Mage_Core_Model_Store::XML_PATH_STORE_IN_URL);
$this->_model->setConfig(Mage_Core_Model_Store::XML_PATH_STORE_IN_URL, 'test');
$this->assertEquals('test', $this->_model->getConfig(Mage_Core_Model_Store::XML_PATH_STORE_IN_URL));
$this->_model->setConfig(Mage_Core_Model_Store::XML_PATH_STORE_IN_URL, $value);
/* Call set before get */
$this->_model->setConfig(Mage_Core_Model_Store::XML_PATH_USE_REWRITES, 1);
$this->assertEquals(1, $this->_model->getConfig(Mage_Core_Model_Store::XML_PATH_USE_REWRITES));
$this->_model->setConfig(Mage_Core_Model_Store::XML_PATH_USE_REWRITES, 0);
}
示例2: sendEmail
/**
* Send email to invitee
*
* @param string $emailAddress
* @param Mage_Core_Model_Store $store
* @param Mage_Customer_Model_Customer $customer
*
* @return boolean
*/
public function sendEmail($emailAddress, $store, $customer)
{
$mail = Mage::getModel('core/email_template');
/* Magento 1.3 stub. */
if (Mage::helper('points')->magentoLess14()) {
$store->setFrontendName($store->getGroup()->getName());
}
/* Magento 1.3 stub ends */
try {
$mail->setDesignConfig(array('area' => 'frontend', 'store' => $store->getStoreId()))->sendTransactional($store->getConfig(self::XML_PATH_EMAIL_TEMPLATE), $store->getConfig(self::XML_PATH_EMAIL_IDENTITY), $this->getEmail(), null, array('url' => $this->prepareUrl($customer, $emailAddress, $store), 'message' => $this->getMessage(), 'store' => $store, 'customer' => $customer));
if ($mail->getSentSuccess()) {
$this->setStatus(self::INVITATION_SENT)->setUpdateDate(true)->save();
return true;
}
} catch (Exception $exc) {
Mage::helper('awcore/logger')->log($this, Mage::helper('points')->__('Error on saving invitation data for email: %s', $emailAddress), AW_Core_Model_Logger::LOG_SEVERITY_ERROR, $exc->getTraceAsString());
}
return false;
}
示例3: getConfig
/**
* Retrieve store configuration data
*
* @param string $path
* @param string $scope
* @return string|null
*/
public function getConfig($path)
{
if ($this->_active) {
if ($this->_config == null) {
$this->_loadOverrideConfigFile();
}
if (isset($this->_config[$path])) {
return $this->_config[$path];
}
}
return parent::getConfig($path);
}
示例4: processEmailEventsForSingleStore
public function processEmailEventsForSingleStore(Mage_Core_Model_Store $store)
{
if ($store->getConfig('mailgun/events/store')) {
$data = array('end' => date("r", time() - 86400), 'tags' => $store->getConfig('mailgun/general/tag'));
$mailgunEvents = $this->mailgunRequest('events', $store->getConfig('mailgun/general/domain'), $store->getConfig('mailgun/general/key'), $data);
$events = $mailgunEvents->items;
while (sizeof($mailgunEvents->items) > 0) {
$mailgunEvents = $this->mailgunRequest('events', $store->getConfig('mailgun/general/domain'), $store->getConfig('mailgun/general/key'), $data, Zend_Http_Client::GET, $mailgunEvents->paging->next);
$events = array_merge($events, $mailgunEvents->items);
}
$this->storeEvents($events);
}
}
示例5: getAmounts
/**
* Get amounts by product and store
*
* @param int $product
* @param Mage_Core_Model_Store $store
* @return array
*/
public function getAmounts($product, $store)
{
$isGlobal = $store->getConfig(Mage_Core_Model_Store::XML_PATH_PRICE_SCOPE) == Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL;
if ($isGlobal) {
$key = $product;
} else {
$website = $store->getWebsiteId();
$key = "{$product}|{$website}";
}
$read = $this->_getReadAdapter();
if (!isset($this->_cache[$key])) {
$select = $read->select()->from($this->getTable('enterprise_giftcard/amount'), array('value', 'website_id'))->where('entity_id = ?', $product);
$bind = array('product_id' => $product);
if ($isGlobal) {
$select->where('website_id = 0');
} else {
$select->where('website_id IN (0, :website_id)');
$bind['website_id'] = $website;
}
$fetched = $read->fetchAll($select, $bind);
$this->_cache[$key] = $this->_convertPrices($fetched, $store);
}
return $this->_cache[$key];
}
示例6: getCookieRestrictionLifetime
/**
* Get cookie restriction lifetime (in seconds)
*
* @return int
*/
public function getCookieRestrictionLifetime()
{
return (int) $this->_currentStore->getConfig(self::XML_PATH_COOKIE_RESTRICTION_LIFETIME);
}
示例7: getFrontendPolicy
/**
* Get frontend policy
*
* @return string|null
*/
public function getFrontendPolicy()
{
return $this->_getDomainPolicyByCode((int) (string) $this->_store->getConfig(self::XML_DOMAIN_POLICY_FRONTEND));
}
示例8: loadData
/**
* Loads the meta data for the given store.
*
* @param Mage_Core_Model_Store $store the store view to load the data for.
*/
public function loadData(Mage_Core_Model_Store $store)
{
$this->_country = $store->getConfig('general/country/default');
}
示例9: _getConfigValueWithDefault
protected function _getConfigValueWithDefault(Mage_Core_Model_Store $store, $path, $default = null)
{
$value = $store->getConfig($path);
if (is_null($value) || '' === $value) {
$value = $default;
}
return $value;
}
示例10: _isLiveCategoryProductReindexEnabled
/**
* Retrieves category/product indexer mode
*
* @return boolean
*/
protected function _isLiveCategoryProductReindexEnabled()
{
return (bool) (string) $this->_store->getConfig(self::XML_PATH_LIVE_CATEGORY_PRODUCT_REINDEX_ENABLED);
}
示例11: loadData
/**
* Loads the meta data for the given store.
*
* @param Mage_Core_Model_Store $store the store view to load the data for.
*/
public function loadData(Mage_Core_Model_Store $store)
{
/** @var Mage_Admin_Model_User $user */
/** @noinspection PhpUndefinedMethodInspection */
$user = Mage::getSingleton('admin/session')->getUser();
/** @var Nosto_Tagging_Helper_Url $urlHelper */
$urlHelper = Mage::helper('nosto_tagging/url');
/** @var Nosto_Tagging_Helper_Data $dataHelper */
$dataHelper = Mage::helper('nosto_tagging/data');
$this->_firstName = $user->getFirstname();
$this->_lastName = $user->getLastname();
$this->_email = $user->getEmail();
$this->_languageIsoCode = substr(Mage::app()->getLocale()->getLocaleCode(), 0, 2);
$this->_languageIsoCodeShop = substr($store->getConfig('general/locale/code'), 0, 2);
$this->_uniqueId = $dataHelper->getInstallationId();
$this->_previewUrlProduct = $urlHelper->getPreviewUrlProduct($store);
$this->_previewUrlCategory = $urlHelper->getPreviewUrlCategory($store);
$this->_previewUrlSearch = $urlHelper->getPreviewUrlSearch($store);
$this->_previewUrlCart = $urlHelper->getPreviewUrlCart($store);
$this->_previewUrlFront = $urlHelper->getPreviewUrlFront($store);
$this->_shopName = $store->getName();
}
示例12: getDefaultAdjustment
public function getDefaultAdjustment(Mage_Core_Model_Store $store)
{
return round(floatval($store->getConfig('shipping/lokey_shippingadjustments/default_pisa_amount')), 2);
}
示例13: addStoreLog
/**
* Add a logger if store configuration allows
*
* @param string $loggerKey
* @param Mage_Core_Model_Store $store
*/
public function addStoreLog($loggerKey, Mage_Core_Model_Store $store)
{
if ($store->getConfig('dev/log/active')) {
$this->addStreamLog($loggerKey);
}
}
示例14: loadData
/**
* Loads the meta data for the given store.
*
* @param Mage_Core_Model_Store $store the store view to load the data for.
*/
public function loadData(Mage_Core_Model_Store $store)
{
$this->_title = $store->getWebsite()->getName() . ' - ' . $store->getGroup()->getName() . ' - ' . $store->getName();
$this->_name = substr(sha1(rand()), 0, 8);
$this->_frontPageUrl = NostoHttpRequest::replaceQueryParamInUrl('___store', $store->getCode(), $store->getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB));
$this->_currencyCode = $store->getBaseCurrencyCode();
$this->_languageCode = substr($store->getConfig('general/locale/code'), 0, 2);
$this->_ownerLanguageCode = substr(Mage::app()->getLocale()->getLocaleCode(), 0, 2);
/** @var Nosto_Tagging_Model_Meta_Account_Owner $owner */
$owner = Mage::getModel('nosto_tagging/meta_account_owner');
$owner->loadData($store);
$this->_owner = $owner;
/** @var Nosto_Tagging_Model_Meta_Account_Billing $billing */
$billing = Mage::getModel('nosto_tagging/meta_account_billing');
$billing->loadData($store);
$this->_billing = $billing;
}
示例15: detectAskAndSetDeveloperIp
/**
* Determine if a developer restriction is in place, and if we're enabling something that will use it
* then notify and ask if it needs to be changed from its current value.
*
* @param \Mage_Core_Model_Store $store
* @param bool $enabled
* @return void
*/
protected function detectAskAndSetDeveloperIp(\Mage_Core_Model_Store $store, $enabled)
{
if (!$enabled) {
// No need to notify about developer IP restrictions if we're disabling template hints etc
return;
}
/** @var OutputInterface $output */
$output = $this->getHelper('io')->getOutput();
if (!($devRestriction = $store->getConfig('dev/restrict/allow_ips'))) {
return;
}
$this->askAndSetDeveloperIp($output, $store, $devRestriction);
}