本文整理汇总了PHP中AO::getStoreConfigFlag方法的典型用法代码示例。如果您正苦于以下问题:PHP AO::getStoreConfigFlag方法的具体用法?PHP AO::getStoreConfigFlag怎么用?PHP AO::getStoreConfigFlag使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AO
的用法示例。
在下文中一共展示了AO::getStoreConfigFlag方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _toHtml
public function _toHtml()
{
if (AO::getStoreConfigFlag('payment/paypaluk_express/active') && AO::getSingleton('checkout/session')->getQuote()->validateMinimumAmount()) {
return parent::_toHtml();
}
return '';
}
示例2: isEnabled
/**
* Check is enable catalog product for store
*
* @param mixed $store
* @return bool
*/
public function isEnabled($store = null)
{
if (AO::app()->getStore($store)->isAdmin()) {
return false;
}
return AO::getStoreConfigFlag(self::XML_PATH_USE_PRODUCT_FLAT, $store);
}
示例3: scheduledGenerateSitemaps
/**
* Generate sitemaps
*
* @param Mage_Cron_Model_Schedule $schedule
*/
public function scheduledGenerateSitemaps($schedule)
{
$errors = array();
// check if scheduled generation enabled
if (!AO::getStoreConfigFlag(self::XML_PATH_GENERATION_ENABLED)) {
return;
}
$collection = AO::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 && AO::getStoreConfig(self::XML_PATH_ERROR_RECIPIENT)) {
$translate = AO::getSingleton('core/translate');
/* @var $translate Mage_Core_Model_Translate */
$translate->setTranslateInline(false);
$emailTemplate = AO::getModel('core/email_template');
/* @var $emailTemplate Mage_Core_Model_Email_Template */
$emailTemplate->setDesignConfig(array('area' => 'backend'))->sendTransactional(AO::getStoreConfig(self::XML_PATH_ERROR_TEMPLATE), AO::getStoreConfig(self::XML_PATH_ERROR_IDENTITY), AO::getStoreConfig(self::XML_PATH_ERROR_RECIPIENT), null, array('warnings' => join("\n", $errors)));
$translate->setTranslateInline(true);
}
}
示例4: preDispatch
public function preDispatch()
{
parent::preDispatch();
if (!AO::getStoreConfigFlag(self::XML_PATH_ENABLED)) {
$this->norouteAction();
}
}
示例5: getFeedUrl
/**
* Retrieve feed url
*
* @return string
*/
public function getFeedUrl()
{
if (is_null($this->_feedUrl)) {
$this->_feedUrl = AO::getStoreConfigFlag(self::XML_USE_HTTPS_PATH) ? 'https://' : 'http://' . AO::getStoreConfig(self::XML_FEED_URL_PATH);
}
return $this->_feedUrl;
}
示例6: getConfigFlag
public function getConfigFlag($field)
{
if (empty($this->_code)) {
return false;
}
$path = 'carriers/' . $this->_code . '/' . $field;
return AO::getStoreConfigFlag($path, $this->getStore());
}
示例7: _toHtml
public function _toHtml()
{
if (!AO::getSingleton('checkout/session')->getQuote()->validateMinimumAmount()) {
return '';
}
if (AO::getStoreConfigFlag('google/checkout/active')) {
return parent::_toHtml();
}
return '';
}
示例8: getActiveMethods
/**
* Retrieve active system payments
*
* @param mixed $store
* @return array
*/
public function getActiveMethods($store = null)
{
$methods = array();
$config = AO::getStoreConfig('payment', $store);
foreach ($config as $code => $methodConfig) {
if (AO::getStoreConfigFlag('payment/' . $code . '/active', $store)) {
$methods[$code] = $this->_getMethod($code, $methodConfig);
}
}
return $methods;
}
示例9: getActiveCarriers
/**
* Retrieve active system carriers
*
* @param mixed $store
* @return array
*/
public function getActiveCarriers($store = null)
{
$carriers = array();
$config = AO::getStoreConfig('carriers', $store);
foreach ($config as $code => $carrierConfig) {
if (AO::getStoreConfigFlag('carriers/' . $code . '/active', $store)) {
$carriers[$code] = $this->_getCarrier($code, $carrierConfig, $store);
}
}
return $carriers;
}
示例10: getAgreements
public function getAgreements()
{
if (!$this->hasAgreements()) {
if (!AO::getStoreConfigFlag('checkout/options/enable_agreements')) {
$agreements = array();
} else {
$agreements = AO::getModel('checkout/agreement')->getCollection()->addStoreFilter(AO::app()->getStore()->getId())->addFieldToFilter('is_active', 1);
}
$this->setAgreements($agreements);
}
return $this->getData('agreements');
}
示例11: _initConfig
/**
* Load some inventory configuration settings
*
*/
protected function _initConfig()
{
if (!$this->_isConfig) {
$this->_isConfig = true;
$this->_isConfigManageStock = (int) AO::getStoreConfigFlag(Mage_CatalogInventory_Model_Stock_Item::XML_PATH_MANAGE_STOCK);
$this->_isConfigBackorders = (int) AO::getStoreConfig(Mage_CatalogInventory_Model_Stock_Item::XML_PATH_BACKORDERS);
$this->_configMinQty = (int) AO::getStoreConfig(Mage_CatalogInventory_Model_Stock_Item::XML_PATH_MIN_QTY);
$this->_configNotifyStockQty = (int) AO::getStoreConfig(Mage_CatalogInventory_Model_Stock_Item::XML_PATH_NOTIFY_STOCK_QTY);
$this->_configTypeIds = array_keys(AO::helper('catalogInventory')->getIsQtyTypeIds(true));
$this->_stock = AO::getModel('cataloginventory/stock');
}
}
示例12: getIsShareable
/**
* Check is link shareable or not
*
* @param Mage_Downloadable_Model_Link | Mage_Downloadable_Model_Link_Purchased_Item $link
* @return bool
*/
public function getIsShareable($link)
{
$shareable = false;
switch ($link->getIsShareable()) {
case Mage_Downloadable_Model_Link::LINK_SHAREABLE_YES:
case Mage_Downloadable_Model_Link::LINK_SHAREABLE_NO:
$shareable = (bool) $link->getIsShareable();
break;
case Mage_Downloadable_Model_Link::LINK_SHAREABLE_CONFIG:
$shareable = (bool) AO::getStoreConfigFlag(Mage_Downloadable_Model_Link::XML_PATH_CONFIG_IS_SHAREABLE);
}
return $shareable;
}
示例13: isAllowed
public function isAllowed($storeId = null)
{
if (is_null($this->_isAllowed)) {
if ($this->design->getArea() === 'adminhtml') {
$active = AO::getStoreConfigFlag('dev/translate_inline/active_admin', $storeId);
} else {
$active = AO::getStoreConfigFlag('dev/translate_inline/active', $storeId);
}
$this->_isAllowed = $active && AO::helper('core')->isDevAllowed($storeId);
}
$translate = AO::getSingleton('core/translate');
/* @var $translate Mage_Core_Model_Translate */
return $translate->getTranslateInline() && $this->_isAllowed;
}
示例14: preDispatch
public function preDispatch()
{
parent::preDispatch();
if (!AO::getSingleton('customer/session')->authenticate($this)) {
$this->setFlag('', 'no-dispatch', true);
if (!AO::getSingleton('customer/session')->getBeforeWishlistUrl()) {
AO::getSingleton('customer/session')->setBeforeWishlistUrl($this->_getRefererUrl());
}
}
if (!AO::getStoreConfigFlag('wishlist/general/active')) {
$this->norouteAction();
return;
}
}
示例15: _toHtml
protected function _toHtml()
{
$newurl = AO::getUrl('rss/catalog/notifystock');
$title = AO::helper('rss')->__('Low Stock Products');
$rssObj = AO::getModel('rss/rss');
$data = array('title' => $title, 'description' => $title, 'link' => $newurl, 'charset' => 'UTF-8');
$rssObj->_addHeader($data);
$_configManageStock = (int) AO::getStoreConfigFlag(Mage_CatalogInventory_Model_Stock_Item::XML_PATH_MANAGE_STOCK);
$stockItemWhere = "({{table}}.low_stock_date is not null) " . " and ({{table}}.low_stock_date>'0000-00-00') " . " and IF({{table}}.use_config_manage_stock=1," . $_configManageStock . ",{{table}}.manage_stock)=1";
$product = AO::getModel('catalog/product');
$collection = $product->getCollection()->addAttributeToSelect('name', true)->addAttributeToSelect('name', true)->joinTable('cataloginventory/stock_item', 'product_id=entity_id', array('qty' => 'qty', 'notify_stock_qty' => 'notify_stock_qty', 'use_config' => 'use_config_notify_stock_qty', 'low_stock_date' => 'low_stock_date'), $stockItemWhere, 'inner')->setOrder('low_stock_date');
$_globalNotifyStockQty = (double) AO::getStoreConfig(Mage_CatalogInventory_Model_Stock_Item::XML_PATH_NOTIFY_STOCK_QTY);
/*
using resource iterator to load the data one by one
instead of loading all at the same time. loading all data at the same time can cause the big memory allocation.
*/
AO::getSingleton('core/resource_iterator')->walk($collection->getSelect(), array(array($this, 'addNotifyItemXmlCallback')), array('rssObj' => $rssObj, 'product' => $product, 'globalQty' => $_globalNotifyStockQty));
return $rssObj->createRssXml();
}