本文整理汇总了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;
}
示例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);
}
}
示例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() . '/';
}
示例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);
}