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


PHP Mage_Core_Model_Website::getConfig方法代码示例

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


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

示例1: exportSubscribersPerWebsite

 /**
  * Export subscriber per website.
  * @param Mage_Core_Model_Website $website
  *
  * @return int
  */
 public function exportSubscribersPerWebsite(Mage_Core_Model_Website $website)
 {
     $updated = 0;
     $fileHelper = Mage::helper('ddg/file');
     $limit = $website->getConfig(Dotdigitalgroup_Email_Helper_Config::XML_PATH_CONNECTOR_SYNC_LIMIT);
     $subscribers = Mage::getModel('ddg_automation/contact')->getSubscribersToImport($website, $limit);
     if (count($subscribers)) {
         $subscribersFilename = strtolower($website->getCode() . '_subscribers_' . date('d_m_Y_Hi') . '.csv');
         //get mapped storename
         $subscriberStorename = Mage::helper('ddg')->getMappedStoreName($website);
         //file headers
         $fileHelper->outputCSV($fileHelper->getFilePath($subscribersFilename), array('Email', 'emailType', $subscriberStorename));
         foreach ($subscribers as $subscriber) {
             try {
                 $email = $subscriber->getEmail();
                 $subscriber->setSubscriberImported(1)->save();
                 $subscriber = Mage::getModel('newsletter/subscriber')->loadByEmail($email);
                 $storeName = Mage::app()->getStore($subscriber->getStoreId())->getName();
                 // save data for subscribers
                 $fileHelper->outputCSV($fileHelper->getFilePath($subscribersFilename), array($email, 'Html', $storeName));
                 $updated++;
             } catch (Exception $e) {
                 Mage::logException($e);
             }
         }
         Mage::helper('ddg')->log('Subscriber filename: ' . $subscribersFilename);
         //register in queue with importer
         Mage::getModel('ddg_automation/importer')->registerQueue(Dotdigitalgroup_Email_Model_Importer::IMPORT_TYPE_SUBSCRIBERS, '', Dotdigitalgroup_Email_Model_Importer::MODE_BULK, $website->getId(), $subscribersFilename);
     }
     //add updated number for the website
     $this->_countSubscriber += $updated;
     return $updated;
 }
开发者ID:vdimitrovv,项目名称:dotmailer-magento-extension,代码行数:39,代码来源:Subscriber.php

示例2: updateDataFields

 /**
  * update data fields
  *
  * @param $email
  * @param Mage_Core_Model_Website $website
  * @param $storeName
  */
 public function updateDataFields($email, Mage_Core_Model_Website $website, $storeName)
 {
     $data = array();
     if ($store_name = $website->getConfig(Dotdigitalgroup_Email_Helper_Config::XML_PATH_CONNECTOR_CUSTOMER_STORE_NAME)) {
         $data[] = array('Key' => $store_name, 'Value' => $storeName);
     }
     if ($website_name = $website->getConfig(Dotdigitalgroup_Email_Helper_Config::XML_PATH_CONNECTOR_CUSTOMER_WEBSITE_NAME)) {
         $data[] = array('Key' => $website_name, 'Value' => $website->getName());
     }
     if (!empty($data)) {
         //update data fields
         $client = $this->getWebsiteApiClient($website);
         $client->updateContactDatafieldsByEmail($email, $data);
     }
 }
开发者ID:vdimitrovv,项目名称:dotmailer-magento-extension,代码行数:22,代码来源:Data.php

示例3: getBaseUrl

 /**
  * Generate a base URL for a website like if it is staging
  *
  * @param   Mage_Core_Model_Website $masterWebsite
  * @param   bool $secure
  * @return  string
  */
 public function getBaseUrl($masterWebsite, $secure = false)
 {
     $this->_ensureWebsite();
     $this->getBaseFolder();
     $masterUri = $masterWebsite->getConfig('web/' . ($secure ? '' : 'un') . 'secure/base_url');
     $masterUri = str_replace($this->_baseFolderName . '/' . $masterWebsite->getCode() . '/', '', $masterUri);
     return $masterUri . $this->_baseFolderName . '/' . $this->_website->getCode() . '/';
 }
开发者ID:hyhoocchan,项目名称:mage-local,代码行数:15,代码来源:Entry.php

示例4: getWebsiteLevelAmqpConfigurations

 /**
  * Return config values that may vary by website/store for the given
  * website.
  * @param  Mage_Core_Model_Website $website
  * @return array Config values for store id, AMQP username and AMQP password
  */
 public function getWebsiteLevelAmqpConfigurations(Mage_Core_Model_Website $website)
 {
     $storeIdPath = $this->_coreConfigMap->getPathForKey(self::STORE_ID_CONFIG_KEY);
     $usernamePath = $this->_amqpConfigMap->getPathForKey(self::USERNAME_CONFIG_KEY);
     $passwordPath = $this->_amqpConfigMap->getPathForKey(self::PASSWORD_CONFIG_KEY);
     $defaultCoreConfig = $this->_coreHelper->getConfigModel(Mage::app()->getStore(0));
     $defaultAmqpConfig = $this->_helper->getConfigModel(Mage::app()->getStore(0));
     // get website level config values, falling back to any not available to the
     // website with default store config values
     return array('store_id' => $website->getConfig($storeIdPath) ?: $defaultCoreConfig->storeId, 'username' => $website->getConfig($usernamePath) ?: $defaultAmqpConfig->username, 'password' => $this->_mageHelper->decrypt($website->getConfig($passwordPath)) ?: $defaultAmqpConfig->password);
 }
开发者ID:sirishreddyg,项目名称:magento-retail-order-management,代码行数:17,代码来源:Config.php


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