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


PHP Mage_Sales_Model_Quote::hasRecurringItems方法代码示例

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


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

示例1: isAvailable

 /**
  * Check whether payment method can be used
  *
  * TODO: payment method instance is not supposed to know about quote
  *
  * @param Mage_Sales_Model_Quote|null $quote
  *
  * @return bool
  */
 public function isAvailable($quote = null)
 {
     $checkResult = new StdClass();
     $isActive = (bool) (int) $this->getConfigData('active', $quote ? $quote->getStoreId() : null);
     $checkResult->isAvailable = $isActive;
     $checkResult->isDeniedInConfig = !$isActive;
     // for future use in observers
     Mage::dispatchEvent('payment_method_is_active', array('result' => $checkResult, 'method_instance' => $this, 'quote' => $quote));
     // disable method if it cannot implement recurring profiles management and there are recurring items in quote
     if ($checkResult->isAvailable) {
         $implementsRecurring = $this->canManageRecurringProfiles();
         // the $quote->hasRecurringItems() causes big performance impact, thus it has to be called last
         if ($quote && !$implementsRecurring && $quote->hasRecurringItems()) {
             $checkResult->isAvailable = false;
         }
     }
     return $checkResult->isAvailable;
 }
开发者ID:ravi2jdesign,项目名称:solvingmagento_1.7.0,代码行数:27,代码来源:Abstract.php

示例2: isApplicableToQuote

 /**
  * Check whether payment method is applicable to quote
  * Purposed to allow use in controllers some logic that was implemented in blocks only before
  *
  * @param Mage_Sales_Model_Quote $quote
  * @param int|null $checksBitMask
  * @return bool
  */
 public function isApplicableToQuote($quote, $checksBitMask)
 {
     if ($checksBitMask & self::CHECK_USE_FOR_COUNTRY) {
         if (!$this->canUseForCountry($quote->getBillingAddress()->getCountry())) {
             return false;
         }
     }
     if ($checksBitMask & self::CHECK_USE_FOR_CURRENCY) {
         if (!$this->canUseForCurrency($quote->getStore()->getBaseCurrencyCode())) {
             return false;
         }
     }
     if ($checksBitMask & self::CHECK_USE_CHECKOUT) {
         if (!$this->canUseCheckout()) {
             return false;
         }
     }
     if ($checksBitMask & self::CHECK_USE_FOR_MULTISHIPPING) {
         if (!$this->canUseForMultishipping()) {
             return false;
         }
     }
     if ($checksBitMask & self::CHECK_USE_INTERNAL) {
         if (!$this->canUseInternal()) {
             return false;
         }
     }
     if ($checksBitMask & self::CHECK_ORDER_TOTAL_MIN_MAX) {
         $total = $quote->getBaseGrandTotal();
         $minTotal = $this->getConfigData('min_order_total');
         $maxTotal = $this->getConfigData('max_order_total');
         if (!empty($minTotal) && $total < $minTotal || !empty($maxTotal) && $total > $maxTotal) {
             return false;
         }
     }
     if ($checksBitMask & self::CHECK_RECURRING_PROFILES) {
         if (!$this->canManageRecurringProfiles() && $quote->hasRecurringItems()) {
             return false;
         }
     }
     if ($checksBitMask & self::CHECK_ZERO_TOTAL) {
         $total = $quote->getBaseSubtotal() + $quote->getShippingAddress()->getBaseShippingAmount();
         if ($total < 0.0001 && $this->getCode() != 'free' && !($this->canManageRecurringProfiles() && $quote->hasRecurringItems())) {
             return false;
         }
     }
     return true;
 }
开发者ID:technomagegithub,项目名称:colb2b,代码行数:56,代码来源:Abstract.php

示例3: isAvailable

 /**
  * Check whether payment method can be used
  *
  * TODO: payment method instance is not supposed to know about quote
  *
  * @param Mage_Sales_Model_Quote|null $quote
  *
  * @return bool
  */
 public function isAvailable($quote = null)
 {
     $checkResult = new StdClass();
     $isActive = (bool) (int) $this->getConfigData('active', $quote ? $quote->getStoreId() : null);
     $shippingMethodRaw = $quote->getShippingAddress()->getShippingMethod();
     $product = $this->_getHelper()->getDPDServiceCode($shippingMethodRaw);
     if (!$isActive || !$quote || !$this->_getHelper()->isShippingMethodDpd($shippingMethodRaw) || !in_array($product, explode(',', $this->getConfigData('specificproducto', $quote->getStoreId()))) || is_null($this->getSurchage())) {
         $isActive = false;
     }
     $checkResult->isAvailable = $isActive;
     $checkResult->isDeniedInConfig = !$isActive;
     // for future use in observers
     Mage::dispatchEvent('payment_method_is_active', array('result' => $checkResult, 'method_instance' => $this, 'quote' => $quote));
     // disable method if it cannot implement recurring profiles management and there are recurring items in quote
     if ($checkResult->isAvailable) {
         $implementsRecurring = $this->canManageRecurringProfiles();
         // the $quote->hasRecurringItems() causes big performance impact, thus it has to be called last
         if ($quote && !$implementsRecurring && $quote->hasRecurringItems()) {
             $checkResult->isAvailable = false;
         }
     }
     return $checkResult->isAvailable;
 }
开发者ID:GabrielCC,项目名称:zitec-dpd-master,代码行数:32,代码来源:Cashondelivery.php


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