本文整理汇总了PHP中Mage::getStoreConfigFlag方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage::getStoreConfigFlag方法的具体用法?PHP Mage::getStoreConfigFlag怎么用?PHP Mage::getStoreConfigFlag使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mage
的用法示例。
在下文中一共展示了Mage::getStoreConfigFlag方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: convertAttribute
/**
* Set current attribute to entry (for specified product)
*
* @param Mage_Catalog_Model_Product $product
* @param Varien_Gdata_Gshopping_Entry $entry
* @return Varien_Gdata_Gshopping_Entry
*/
public function convertAttribute($product, $entry)
{
$url = $product->getProductUrl(false);
if ($url) {
if (!Mage::getStoreConfigFlag('web/url/use_store')) {
$urlInfo = parse_url($url);
$store = $product->getStore()->getCode();
if (isset($urlInfo['query']) && $urlInfo['query'] != '') {
$url .= '&___store=' . $store;
} else {
$url .= '?___store=' . $store;
}
}
$links = $entry->getLink();
if (!is_array($links)) {
$links = array();
}
$link = $entry->getService()->newLink();
$link->setHref($url);
$link->setRel('alternate');
$link->setType('text/html');
if ($product->getName()) {
$link->setTitle($product->getName());
}
$links[0] = $link;
$entry->setLink($links);
}
return $entry;
}
示例2: getFeedUrl
public function getFeedUrl()
{
if (is_null($this->_feedUrl)) {
$this->_feedUrl = (Mage::getStoreConfigFlag(self::XML_USE_HTTPS_PATH) ? 'https://' : 'http://') . Mage::getStoreConfig(self::XML_FEED_URL_PATH);
}
return $this->_feedUrl;
}
示例3: scheduledGenerateSitemaps
/**
* Generate sitemaps
*
* @param Mage_Cron_Model_Schedule $schedule
*/
public function scheduledGenerateSitemaps($schedule)
{
$errors = array();
// check if scheduled generation enabled
if (!Mage::getStoreConfigFlag(self::XML_PATH_GENERATION_ENABLED)) {
return;
}
$collection = Mage::getModel('sitemap/sitemap')->getCollection();
/* @var $collection Mage_Sitemap_Model_Mysql4_Sitemap_Collection */
foreach ($collection as $sitemap) {
/* @var $sitemap Mage_Sitemap_Model_Sitemap */
try {
$sitemap->generateXml();
} catch (Exception $e) {
$errors[] = $e->getMessage();
}
}
if ($errors && Mage::getStoreConfig(self::XML_PATH_ERROR_RECIPIENT)) {
$translate = Mage::getSingleton('core/translate');
/* @var $translate Mage_Core_Model_Translate */
$translate->setTranslateInline(false);
$emailTemplate = Mage::getModel('core/email_template');
/* @var $emailTemplate Mage_Core_Model_Email_Template */
$emailTemplate->setDesignConfig(array('area' => 'backend'))->sendTransactional(Mage::getStoreConfig(self::XML_PATH_ERROR_TEMPLATE), Mage::getStoreConfig(self::XML_PATH_ERROR_IDENTITY), Mage::getStoreConfig(self::XML_PATH_ERROR_RECIPIENT), null, array('warnings' => join("\n", $errors)));
$translate->setTranslateInline(true);
}
}
示例4: isOutputEnabled
/**
* Check whether or not the module output is enabled
*
* Because many module blocks belong to Adminhtml module,
* the feature "Disable module output" doesn't cover Admin area
*
* @param string $moduleName Full module name
* @return boolean
*/
public function isOutputEnabled($moduleName = null)
{
if ($moduleName === null) {
$moduleName = $this->getModuleName();
}
return !Mage::getStoreConfigFlag('advanced/modules_disable_output/' . $moduleName);
}
示例5: dispatchAlways
/**
* Process cron queue for tasks marked as 'always'
*
* @param Varien_Event_Observer $observer
*/
public function dispatchAlways(Varien_Event_Observer $observer)
{
if (!Mage::getStoreConfigFlag('system/cron/enable')) {
return;
}
$processManager = Mage::getModel('aoe_scheduler/processManager');
/* @var $processManager Aoe_Scheduler_Model_ProcessManager */
$processManager->watchdog();
$scheduleManager = Mage::getModel('aoe_scheduler/scheduleManager');
/* @var $scheduleManager Aoe_Scheduler_Model_ScheduleManager */
$helper = Mage::helper('aoe_scheduler');
/* @var Aoe_Scheduler_Helper_Data $helper */
$includeJobs = $helper->addGroupJobs((array) $observer->getIncludeJobs(), (array) $observer->getIncludeGroups());
$excludeJobs = $helper->addGroupJobs((array) $observer->getExcludeJobs(), (array) $observer->getExcludeGroups());
/* @var $jobs Aoe_Scheduler_Model_Resource_Job_Collection */
$jobs = Mage::getSingleton('aoe_scheduler/job')->getCollection();
$jobs->setWhiteList($includeJobs);
$jobs->setBlackList($excludeJobs);
$jobs->setActiveOnly(true);
foreach ($jobs as $job) {
/* @var Aoe_Scheduler_Model_Job $job */
if ($job->isAlwaysTask() && $job->getRunModel()) {
$schedule = $scheduleManager->getScheduleForAlwaysJob($job->getJobCode());
if ($schedule !== false) {
$schedule->process();
}
}
}
}
示例6: _toHtml
protected function _toHtml()
{
if (Mage::getStoreConfigFlag('rewards/autointegration/product_view_warnguest')) {
return parent::_toHtml();
}
return '';
}
示例7: indexAction
public function indexAction()
{
$storeId = $this->getRequest()->getParam('store');
$groupId = $this->getRequest()->getParam('group');
if (null === $storeId || null === $groupId) {
if (null === $storeId) {
$storeId = Mage::getSingleton('admin/session')->getCmsLastViewedStore();
if (null === $storeId) {
if (Mage::app()->isSingleStoreMode()) {
$storeId = Mage::app()->getDefaultStoreView()->getId();
} else {
$storeId = 0;
}
}
}
if (!$groupId) {
$groupId = Mage_Customer_Model_Group::NOT_LOGGED_IN_ID;
}
$this->_redirect('*/*/', array('store' => $storeId, 'group' => $groupId));
return;
}
Mage::getSingleton('admin/session')->setCmsLastViewedStore($storeId);
if (!Mage::getStoreConfigFlag('cms/clever/permissions_enabled')) {
$this->_getSession()->addNotice($this->__('Permissions are currently disabled. To enable permissions, go to System > Configuration > Content Management > Clever CMS.'));
}
$this->_title($this->__('CMS'))->_title($this->__('Pages'))->_title($this->__('Manage Content Permissions'));
$this->_initAction();
$this->renderLayout();
}
示例8: showMessage
public function showMessage($message, $isError = true, $showEachTime = false)
{
if (!Mage::getStoreConfigFlag('ampromo/messages/errors') && $isError) {
return;
}
if (!Mage::getStoreConfigFlag('ampromo/messages/success') && !$isError) {
return;
}
// show on cart page only
$all = Mage::getSingleton('checkout/session')->getMessages(false)->toString();
if (false !== strpos($all, $message)) {
return;
}
if ($isError && isset($_GET['debug'])) {
Mage::getSingleton('checkout/session')->addError($message);
} else {
$arr = Mage::getSingleton('checkout/session')->getAmpromoMessages();
if (!is_array($arr)) {
$arr = array();
}
if (!in_array($message, $arr) || $showEachTime) {
Mage::getSingleton('checkout/session')->addNotice($message);
$arr[] = $message;
Mage::getSingleton('checkout/session')->setAmpromoMessages($arr);
}
}
}
示例9: useIncludedZurb
/**
* Check if the included Zurb Foundation should be used
*
* @return bool
*/
public function useIncludedZurb()
{
if (Mage::getStoreConfigFlag(self::XML_PATH_USE_INCLUDED_ZURB)) {
return true;
}
return false;
}
示例10: preDispatch
public function preDispatch()
{
parent::preDispatch();
if (!Mage::getStoreConfigFlag('productlist/general_setting/show')) {
$this->norouteAction();
}
}
示例11: __construct
public function __construct()
{
$availableByIP = true;
if (Mage::getStoreConfig('msp/msp_payafter/ip_check')) {
if ($this->_isTestMode()) {
$data = Mage::getStoreConfig('msp/msp_payafter/ip_filter_test');
} else {
$data = Mage::getStoreConfig('msp/msp_payafter/ip_filter');
}
if (!in_array($_SERVER["REMOTE_ADDR"], explode(';', $data))) {
$availableByIP = false;
}
}
$currencies = explode(',', Mage::getStoreConfig('msp/' . $this->_code . '/allowed_currency'));
$isAllowConvert = Mage::getStoreConfigFlag('msp/settings/allow_convert_currency');
if ($isAllowConvert) {
$availableByCurrency = true;
} else {
if (in_array(Mage::app()->getStore()->getCurrentCurrencyCode(), $currencies)) {
$availableByCurrency = true;
} else {
$availableByCurrency = false;
}
}
$this->_canUseCheckout = $availableByIP && $availableByCurrency;
}
示例12: httpResponseSendBefore
/**
* When caching a page simply generate and cache a random value as the ETag
*
* @param Mage_Core_Controller_Response_Http $response
* @param $lifetime
*/
public function httpResponseSendBefore(Mage_Core_Controller_Response_Http $response, $lifetime)
{
$useEtags = Mage::getStoreConfigFlag('system/diehard/use_etags');
$cacheKey = $this->getCacheKey();
// Use existing cache data if it exists in case there are multiple upstream proxies
// If a record exists then any content generated at the time the record was is assumed to not be stale
if (!($cacheData = Mage::app()->loadCache($cacheKey))) {
$fullActionName = $this->helper()->getFullActionName();
if ($useEtags) {
$cacheData = $fullActionName . ':' . sha1(microtime() . mt_rand());
} else {
$cacheData = $fullActionName . ':' . $this->_rfc1123Date();
}
$tags = $this->helper()->getTags();
$tags[] = Cm_Diehard_Helper_Data::CACHE_TAG;
Mage::app()->saveCache($cacheData, $cacheKey, $tags, $lifetime);
}
list($fullActionName, $cacheData) = explode(':', $cacheData, 2);
// Set headers so the page is cached with the ETag/Last-Modified value for invalidation
session_cache_limiter('');
$cacheControl = sprintf(Mage::getStoreConfig('system/diehard/cachecontrol'), $lifetime);
$response->setHeader('Cache-Control', $cacheControl, true);
$response->setHeader('Expires', $this->_rfc1123Date(time() + $lifetime), true);
if ($useEtags) {
$response->setHeader('ETag', 'W/"' . $cacheData . '"', true);
} else {
$response->setHeader('Last-Modified', $cacheData, true);
}
}
示例13: getItemCollection
/**
* Get crosssell items
*
* @return array
*/
public function getItemCollection()
{
if (!Mage::helper('conversionpro')->isActiveEngine() || !Mage::getStoreConfigFlag('conversionpro/crosssell_settings/upsell_enabled')) {
return parent::getItemCollection();
}
if (is_null($this->_itemCollection)) {
$lastAdded = null;
//This code path covers the 2 cases - product page and shopping cart
if ($this->getProduct() != null) {
$lastAdded = $this->getProduct()->getId();
} else {
$cartProductIds = $this->_getCartProductIds();
$lastAdded = null;
for ($i = count($cartProductIds) - 1; $i >= 0; $i--) {
$id = $cartProductIds[$i];
$parentIds = Mage::getModel('catalog/product_type_configurable')->getParentIdsByChild($id);
if (empty($parentIds)) {
$lastAdded = $id;
break;
}
}
}
$crossSellIds = Mage::helper('conversionpro')->getSalespersonCrossSellApi()->getRecommendationsIds($lastAdded);
$this->_maxItemCount = Mage::getStoreConfig('conversionpro/crosssell_settings/upsell_limit');
$this->_itemCollection = $this->_getCollection()->addAttributeToFilter('entity_id', array('in' => $crossSellIds));
}
return $this->_itemCollection;
}
示例14: postAction
/**
* Submit new review action
*
*/
public function postAction()
{
if (Mage::getStoreConfigFlag(self::XML_PATH_PRC_ENABLED)) {
try {
$post = $this->getRequest()->getPost();
if ($post) {
//include reCaptcha library
require_once Mage::getModuleDir('', 'OlegKoval_ProductReviewCaptcha') . DS . 'Helper' . DS . 'recaptchalib.php';
//validate captcha
$privatekey = Mage::getStoreConfig(self::XML_PATH_PRC_PRIVATE_KEY);
$remote_addr = $this->getRequest()->getServer('REMOTE_ADDR');
$captcha = recaptcha_check_answer($privatekey, $remote_addr, $post["recaptcha_challenge_field"], $post["recaptcha_response_field"]);
if (!$captcha->is_valid) {
throw new Exception($this->__("The reCAPTCHA wasn't entered correctly."), 1);
}
} else {
throw new Exception('', 1);
}
} catch (Exception $e) {
if (strlen($e->getMessage()) > 0) {
Mage::getSingleton('core/session')->addError($this->__($e->getMessage()));
Mage::getSingleton('core/session')->setFormData($post);
}
if ($redirectUrl = Mage::getSingleton('review/session')->getRedirectUrl(true)) {
$this->_redirectUrl($redirectUrl);
return;
}
$this->_redirectReferer();
return;
}
}
//everything is OK - call parent action
parent::postAction();
}
示例15: isPiwikAnalyticsAvailable
/**
*
* @param mixed $store
* @return bool
*/
public function isPiwikAnalyticsAvailable($store = null)
{
$siteId = Mage::getStoreConfig(self::XML_PATH_SITE, $store);
//$installPath = Mage::getStoreConfig(self::XML_PATH_INSTALL, $store);
//return $siteId && $installPath && Mage::getStoreConfigFlag(self::XML_PATH_ACTIVE, $store);
return $siteId && Mage::getStoreConfigFlag(self::XML_PATH_ACTIVE, $store);
}