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


PHP Mage_Sales_Model_Quote::getBaseSubtotal方法代码示例

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


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

示例1: _fillCartInformation

 /**
  * @param array $data
  * @param Mage_Sales_Model_Quote|Mage_Sales_Model_Order $object
  */
 private function _fillCartInformation(&$data, $object)
 {
     $productIids = array();
     $productQtys = array();
     $productStyleIds = array();
     /** @var Mage_Sales_Model_Quote_Item|Mage_Sales_Model_Order_Item $item */
     foreach ($object->getAllVisibleItems() as $item) {
         $productIids[] = $item->getProduct()->getIid();
         $productQtys[] = is_null($item->getQtyOrdered()) ? (int) $item->getQty() : (int) $item->getQtyOrdered();
         $productStyleIds[] = $item->getProduct()->getNumber() . '-' . $item->getProduct()->getColorCode();
     }
     $data['productStyleId'] = implode(',', $productStyleIds);
     $data['cartProductIds'] = implode(',', $productIids);
     $data['cartProductQtys'] = implode(',', $productQtys);
     $data['cartTotalNetto'] = round($object->getBaseSubtotal(), 2);
     $data['cartTotalBrutto'] = round($object->getBaseGrandTotal(), 2);
     $data['customerId'] = (int) $object->getCustomerId();
     // For zanox tracking
     if (array_key_exists('zanpid', $_COOKIE) && $_COOKIE['zanpid'] != '') {
         $data['zanpid'] = $_COOKIE['zanpid'];
     }
 }
开发者ID:jronatay,项目名称:ultimo-magento-jron,代码行数:26,代码来源:Observer.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: buildAmount

 /**
  * Build Amount
  *
  * @param Mage_Sales_Model_Quote $quote
  * @return Amount
  */
 protected function buildAmount($quote)
 {
     $details = new Details();
     $details->setShipping($quote->getShippingAddress()->getBaseShippingAmount())->setTax($quote->getBillingAddress()->getBaseTaxAmount() + $quote->getBillingAddress()->getBaseHiddenTaxAmount() + $quote->getShippingAddress()->getBaseTaxAmount() + $quote->getShippingAddress()->getBaseHiddenTaxAmount())->setSubtotal($quote->getBaseSubtotal());
     $totals = $quote->getTotals();
     if (isset($totals['discount']) && $totals['discount']->getValue()) {
         $details->setShippingDiscount(-$totals['discount']->getValue());
     }
     $amount = new Amount();
     $amount->setCurrency($quote->getBaseCurrencyCode())->setDetails($details)->setTotal($quote->getBaseGrandTotal());
     return $amount;
 }
开发者ID:kirchbergerknorr,项目名称:iways_paypalplus,代码行数:18,代码来源:Api.php


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