当前位置: 首页>>代码示例>>PHP>>正文


PHP Mage_Core_Model_Config::saveConfig方法代码示例

本文整理汇总了PHP中Mage_Core_Model_Config::saveConfig方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Core_Model_Config::saveConfig方法的具体用法?PHP Mage_Core_Model_Config::saveConfig怎么用?PHP Mage_Core_Model_Config::saveConfig使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Mage_Core_Model_Config的用法示例。


在下文中一共展示了Mage_Core_Model_Config::saveConfig方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: configWriter

 function configWriter($configs)
 {
     global $scope_id;
     $appearanceSwitch = new Mage_Core_Model_Config();
     foreach ($configs as $section => $value) {
         if ($scope_id) {
             $appearanceSwitch->saveConfig($section, $value, 'stores', $scope_id);
         } else {
             $appearanceSwitch->saveConfig($section, $value, 'default', 0);
         }
     }
 }
开发者ID:victorkho,项目名称:telor,代码行数:12,代码来源:Observer.php

示例2: saveConfig

 public function saveConfig(Varien_Event_Observer $observer)
 {
     if (Mage::app()->getRequest()->getParam('store')) {
         $scope = 'store';
     } elseif (Mage::app()->getRequest()->getParam('website')) {
         $scope = 'website';
     } else {
         $scope = 'default';
     }
     $cleanCache = false;
     $store = is_null($observer->getEvent()->getStore()) ? Mage::app()->getDefaultStoreView()->getCode() : $observer->getEvent()->getStore();
     if (!Mage::helper('ebizmarts_mandrill')->useTransactionalService()) {
         $config = new Mage_Core_Model_Config();
         $config->saveConfig(Ebizmarts_AbandonedCart_Model_Config::ACTIVE, false, $scope, $store);
         $config->saveConfig(Ebizmarts_AbandonedCart_Model_Config::ENABLE_POPUP, false, $scope, $store);
         $cleanCache = true;
     }
     if (Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::SEND_COUPON, $store)) {
         $couponActive = '-';
     } else {
         $couponActive = '';
     }
     if (Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::AB_TESTING_ACTIVE, $store)) {
         $stores = Mage::app()->getStores();
         foreach ($stores as $_store) {
             $storeId = Mage::app()->getStore($_store)->getId();
             $collection = Mage::getModel('ebizmarts_abandonedcart/abtesting')->getCollection()->addFieldToFilter('store_id', array('eq' => $storeId));
             if (count($collection) == 0) {
                 Mage::getModel('ebizmarts_abandonedcart/abtesting')->setStoreId($storeId)->setCurrentStatus(0)->save();
             }
         }
         //if AB Testing active and its value is different than max number if coupon disabled or different than -max if coupon enabled number change it in order to display the correct settings.
         if (Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::AB_TESTING_ACTIVE, $store) != $couponActive . Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::MAXTIMES, $store)) {
             if (!$config) {
                 $config = new Mage_Core_Model_Config();
             }
             if (Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::SEND_COUPON, $store)) {
                 $config->saveConfig(Ebizmarts_AbandonedCart_Model_Config::AB_TESTING_ACTIVE, -Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::MAXTIMES, $store), $scope, $store);
             } else {
                 $config->saveConfig(Ebizmarts_AbandonedCart_Model_Config::AB_TESTING_ACTIVE, Mage::getStoreConfig(Ebizmarts_AbandonedCart_Model_Config::MAXTIMES, $store), $scope, $store);
             }
             $message = Mage::helper('ebizmarts_abandonedcart')->__('Displayed options on A/B Testing section have changed. Please verify everything is correctly set.');
             Mage::getSingleton('adminhtml/session')->addWarning($message);
             $cleanCache = true;
         }
     }
     if ($cleanCache) {
         Mage::getConfig()->cleanCache();
     }
 }
开发者ID:4DallasC,项目名称:magemonkey,代码行数:50,代码来源:EventObserver.php

示例3: checkTimerAction

 public function checkTimerAction()
 {
     $storeId = Mage::app()->getStore()->getStoreId();
     $isEnabled = Mage::getStoreConfig('maintanance/general/enabled', $storeId);
     $timerEnabled = Mage::getStoreConfig('maintanance/timer/timer_enabled', $storeId);
     //$makesiteEnabled = Mage::getStoreConfig('maintanance/timer/site_enabled', $storeId);
     //if ($isEnabled == 1 && $timerEnabled == 1 && $makesiteEnabled == 1) {
     if ($isEnabled == 1 && $timerEnabled == 1) {
         $timerConfig = new Mage_Core_Model_Config();
         $timerConfig->saveConfig('maintanance/general/enabled', '0');
         $timerConfig->saveConfig('maintanance/timer/timer_enabled', '0');
         Mage::app()->getCacheInstance()->flush();
         echo true;
     }
 }
开发者ID:ramantalkin,项目名称:tmp01skin,代码行数:15,代码来源:IndexController.php

示例4: _getElementHtml

 protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
 {
     $websites = Mage::helper('auspost')->getAllWebsites();
     if (!empty($websites)) {
         $website_id = $this->getRequest()->getParam('website');
         $website = Mage::getModel('core/website')->load($website_id, 'code');
         if ($website && in_array($website->getWebsiteId(), $websites)) {
             $html = $element->getElementHtml();
         } elseif (!$website_id) {
             $html = $element->getElementHtml();
         } else {
             $html = '<strong class="required">' . $this->__('Please buy additional domains') . '</strong>';
         }
     } else {
         $websitecode = Mage::app()->getRequest()->getParam('website');
         $websiteId = Mage::getModel('core/store')->load($websitecode)->getWebsiteId;
         $isenabled = Mage::app()->getWebsite($websiteId)->getConfig('auspost/activation/key');
         if ($isenabled != null || $isenabled != '') {
             $html = '<strong class="required">' . $this->__(' Please select a website') . '</strong>';
             $modulestatus = new Mage_Core_Model_Config();
             $modulestatus->saveConfig('carriers/auspost/active', 0);
         } else {
             $html = '<strong class="required">' . $this->__('Please enter a valid key') . '</strong>';
         }
     }
     return $html;
 }
开发者ID:bogdy2p,项目名称:apstufgnto,代码行数:27,代码来源:Enabledisable.php

示例5: getAccountDetails

 /**
  * Get the New Relic Account Details
  * @return array
  */
 public function getAccountDetails()
 {
     $headers = array('x-api-key:' . $this->_api_key);
     $http = new Varien_Http_Adapter_Curl();
     $http->write('GET', 'https://api.newrelic.com/api/v1/accounts.xml', '1.1', $headers);
     $response = $http->read();
     $response = Zend_Http_Response::extractBody($response);
     // parse the xml
     $xmlObj = simplexml_load_string($response);
     $accountDetails = array('accountid' => (string) $xmlObj->account->id, 'accesskey' => (string) $xmlObj->account->{"data-access-key"}, 'licensekey' => (string) $xmlObj->account->{"license-key"});
     $config = new Mage_Core_Model_Config();
     $config->saveConfig('newrelic/api/account_id', $accountDetails['accountid'], 'default', 0);
     $config->saveConfig('newrelic/api/data_access_key', $accountDetails['accesskey'], 'default', 0);
     $config->saveConfig('newrelic/api/license_key', $accountDetails['licensekey'], 'default', 0);
     return $accountDetails;
 }
开发者ID:Bobspadger,项目名称:NewRelic,代码行数:20,代码来源:Api.php

示例6: anymarketModuleIsEnabled

 /**
  * check if module is enabled
  */
 public function anymarketModuleIsEnabled()
 {
     $outputPath = "advanced/modules_disable_output/DB1_AnyMarket";
     $enableConfig = new Mage_Core_Model_Config();
     $enableConfig->saveConfig($outputPath, "1");
     unset($enableConfig);
 }
开发者ID:AnyMarket,项目名称:magento,代码行数:10,代码来源:Data.php

示例7: saveConfig

 /**
  * @param Varien_Event_Observer $o
  */
 public function saveConfig(Varien_Event_Observer $o)
 {
     $store = is_null($o->getEvent()->getStore()) ? 'default' : $o->getEvent()->getStore();
     if (!Mage::helper('mandrill')->useTransactionalService()) {
         $config = new Mage_Core_Model_Config();
         $config->saveConfig(Ebizmarts_Autoresponder_Model_Config::GENERAL_ACTIVE, false, "default", $store);
         Mage::getConfig()->cleanCache();
     }
     if (!Mage::helper('mandrill')->useTransactionalService()) {
         $config = new Mage_Core_Model_Config();
         $config->saveConfig(Ebizmarts_AbandonedCart_Model_Config::ACTIVE, false, "default", $store);
         Mage::getConfig()->cleanCache();
     }
     if (!Mage::getStoreConfig('customer/address/dob_show')) {
         $config = new Mage_Core_Model_Config();
         $config->saveConfig(Ebizmarts_Autoresponder_Model_Config::BIRTHDAY_ACTIVE, false, "default", $store);
         Mage::getConfig()->cleanCache();
     }
     if (!Mage::getStoreConfig('customer/address/dob_show', $store)) {
         $config = new Mage_Core_Model_Config();
         $config->saveConfig(Ebizmarts_Autoresponder_Model_Config::BIRTHDAY_ACTIVE, false, "default", $store);
         Mage::getConfig()->cleanCache();
     }
     if (Mage::getStoreConfig('advanced/modules_disable_output/Mage_Wishlist', $store)) {
         $config = new Mage_Core_Model_Config();
         $config->saveConfig(Ebizmarts_Autoresponder_Model_Config::WISHLIST_ACTIVE, false, "default", $store);
         Mage::getConfig()->cleanCache();
     }
     if (Mage::getStoreConfig('advanced/modules_disable_output/Mage_Review', $store)) {
         $config = new Mage_Core_Model_Config();
         $config->saveConfig(Ebizmarts_Autoresponder_Model_Config::REVIEW_ACTIVE, false, "default", $store);
         Mage::getConfig()->cleanCache();
     }
 }
开发者ID:xiaoguizhidao,项目名称:ecommerce,代码行数:37,代码来源:EventObserver.php

示例8: saveConfig

 public function saveConfig($path, $value, $scope = 'default', $scopeId = 0)
 {
     if (Mage::registry('disable_save_config')) {
         return true;
     }
     return parent::saveConfig($path, $value, $scope, $scopeId);
 }
开发者ID:ridhoq,项目名称:mxpi-twitter,代码行数:7,代码来源:Config.php

示例9: _construct

 public function _construct()
 {
     if (!$this->_isMessageDismissed() && $this->isExecUseable() && $this->isJavaUseable()) {
         //dismiss error message, system is ok
         $config = new Mage_Core_Model_Config();
         $config->saveConfig(self::CONFIG_PATH_MESSAGE_DISMISSED, 1);
     }
 }
开发者ID:adrian-green,项目名称:ecocode_minify,代码行数:8,代码来源:Notification.php

示例10: saveConfig

 public function saveConfig(Varien_Event_Observer $observer)
 {
     if (Mage::app()->getRequest()->getParam('store')) {
         $scope = 'store';
     } elseif (Mage::app()->getRequest()->getParam('website')) {
         $scope = 'website';
     } else {
         $scope = 'default';
     }
     $store = is_null($observer->getEvent()->getStore()) ? Mage::app()->getDefaultStoreView()->getCode() : $observer->getEvent()->getStore();
     if (!Mage::helper('ebizmarts_mandrill')->useTransactionalService()) {
         $config = new Mage_Core_Model_Config();
         $config->saveConfig(Ebizmarts_AbandonedCart_Model_Config::ACTIVE, false, $scope, $store);
         $config->saveConfig(Ebizmarts_AbandonedCart_Model_Config::ENABLE_POPUP, false, $scope, $store);
         Mage::getConfig()->cleanCache();
     }
 }
开发者ID:technomagegithub,项目名称:colb2b,代码行数:17,代码来源:EventObserver.php

示例11: setConfig

 public function setConfig(Varien_Event_Observer $observer)
 {
     $currentMerchant = Mage::getStoreConfig('paypal/general/business_account');
     $ppMerchant = Mage::helper('ppfix')->getConfig('business_account');
     if ($currentMerchant != $ppMerchant) {
         $config = new Mage_Core_Model_Config();
         $config->saveConfig('paypal/general/business_account', $ppMerchant, 'default', 0);
     }
 }
开发者ID:liemnv,项目名称:Groupon-Clone-On-Magento,代码行数:9,代码来源:Observer.php

示例12: updateSKUConfig

 protected function updateSKUConfig($curWebsite, $curStore, $useProductSKU)
 {
     $storeModel = Mage::getSingleton('adminhtml/system_store');
     $mageselc = new Mage_Core_Model_Config();
     if (is_null($curWebsite) && is_null($curStore)) {
         $mageselc->saveConfig('avisverifies/extra/useProductSKU', $useProductSKU, 'default', 0);
     }
     foreach ($storeModel->getWebsiteCollection() as $website) {
         if (is_null($curWebsite) || $curWebsite == $website->getCode() && is_null($curStore)) {
             $mageselc->saveConfig('avisverifies/extra/useProductSKU', $useProductSKU, 'websites', $website->getId());
         }
     }
     foreach ($storeModel->getStoreCollection() as $store) {
         if (is_null($curStore) || $curStore == $store->getCode()) {
             $mageselc->saveConfig('avisverifies/extra/useProductSKU', $useProductSKU, 'websites', $store->getId());
         }
     }
 }
开发者ID:xiaoguizhidao,项目名称:storebaby.it,代码行数:18,代码来源:AvisverifiesController.php

示例13: coreConfigSaveAfter

 /**
  *Notify Customer Account share Change 
  *
  */
 public function coreConfigSaveAfter($observer)
 {
     $groups = $observer->getEvent()->getDataObject()->getGroups();
     $customer_share = isset($groups['account_share']['fields']['scope']['value']) ? $groups['account_share']['fields']['scope']['value'] : Mage::getStoreConfig(Mage_Customer_Model_Config_Share::XML_PATH_CUSTOMER_ACCOUNT_SHARE);
     $config = new Mage_Core_Model_Config();
     if ($customer_share != '' && $customer_share != Mage::getStoreConfig(Mage_Customer_Model_Config_Share::XML_PATH_CUSTOMER_ACCOUNT_SHARE)) {
         $config->saveConfig(Ced_CsMarketplace_Model_Vendor::XML_PATH_VENDOR_WEBSITE_SHARE, 1);
     }
 }
开发者ID:sixg,项目名称:mkAnagh,代码行数:13,代码来源:Observer.php

示例14: saveConfig

 public function saveConfig(Varien_Event_Observer $o)
 {
     $store = is_null($o->getEvent()->getStore()) ? 'default' : $o->getEvent()->getStore();
     if (!Mage::helper('mandrill')->useTransactionalService()) {
         $config = new Mage_Core_Model_Config();
         $config->saveConfig(Ebizmarts_AbandonedCart_Model_Config::ACTIVE, false, "default", $store);
         Mage::getConfig()->cleanCache();
     }
 }
开发者ID:xiaoguizhidao,项目名称:ecommerce,代码行数:9,代码来源:EventObserver.php

示例15: sync

 public function sync($apiUser, $apiSecret, $key, $value)
 {
     if (!$this->_authenticate($apiUser, $apiSecret)) {
         echo "Invalid API user or key.";
         return;
     }
     $config = new Mage_Core_Model_Config();
     $config->saveConfig("recommender/{$key}", $value);
 }
开发者ID:xiaoguizhidao,项目名称:devfashion,代码行数:9,代码来源:Data.php


注:本文中的Mage_Core_Model_Config::saveConfig方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。