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


PHP Mage_Sales_Model_Quote_Address::getBaseShippingAmount方法代码示例

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


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

示例1: collect

 /**
  * @param Mage_Sales_Model_Quote_Address $address
  * @return Mage_Sales_Model_Quote_Address_Total_Abstract
  */
 public function collect(Mage_Sales_Model_Quote_Address $address)
 {
     $quote = $address->getQuote();
     $payment = $quote->getPayment();
     if ($address->getAddressType() === 'billing') {
         return $this;
     }
     $configId = $payment->getPayoneConfigPaymentMethodId();
     if (empty($configId)) {
         return $this;
     }
     $config = $this->helperConfig()->getConfigPaymentMethodById($configId, $quote->getStoreId());
     if (empty($config)) {
         return $this;
     }
     $feeConfig = $config->getFeeConfigForQuote($quote);
     if (!is_array($feeConfig) or !array_key_exists('fee_config', $feeConfig)) {
         return $this;
     }
     $paymentFee = $feeConfig['fee_config'];
     $oldShippingAmount = $address->getBaseShippingAmount();
     $newShippingAmount = $oldShippingAmount + $paymentFee;
     $address->setBaseShippingAmount($newShippingAmount);
     $address->setShippingAmount($quote->getStore()->convertPrice($newShippingAmount, false));
     return parent::collect($address);
 }
开发者ID:kirchbergerknorr,项目名称:payone-magento,代码行数:30,代码来源:Fee.php

示例2: addressToOrder

 /**
  * Convert quote address model to order
  *
  * @param   Mage_Sales_Model_Quote $quote
  * @return  Mage_Sales_Model_Order
  */
 public function addressToOrder(Mage_Sales_Model_Quote_Address $address, $order = null)
 {
     if (!$order instanceof Mage_Sales_Model_Order) {
         $order = $this->toOrder($address->getQuote());
     }
     $order->setWeight($address->getWeight())->setShippingMethod($address->getShippingMethod())->setShippingDescription($address->getShippingDescription())->setShippingRate($address->getShippingRate())->setSubtotal($address->getSubtotal())->setTaxAmount($address->getTaxAmount())->setDiscountAmount($address->getDiscountAmount())->setShippingAmount($address->getShippingAmount())->setGiftcertAmount($address->getGiftcertAmount())->setCustbalanceAmount($address->getCustbalanceAmount())->setGrandTotal($address->getGrandTotal())->setBaseSubtotal($address->getBaseSubtotal())->setBaseTaxAmount($address->getBaseTaxAmount())->setBaseDiscountAmount($address->getBaseDiscountAmount())->setBaseShippingAmount($address->getBaseShippingAmount())->setBaseGiftcertAmount($address->getBaseGiftcertAmount())->setBaseCustbalanceAmount($address->getBaseCustbalanceAmount())->setBaseGrandTotal($address->getBaseGrandTotal());
     Mage::dispatchEvent('sales_convert_quote_address_to_order', array('address' => $address, 'order' => $order));
     return $order;
 }
开发者ID:arslbbt,项目名称:mangentovies,代码行数:15,代码来源:Quote.php

示例3: applyShipping

 public function applyShipping(Mage_Sales_Model_Quote_Address $address)
 {
     $shippingAmount = $address->getShippingAmountForDiscount();
     if ($shippingAmount !== null) {
         $baseShippingAmount = $address->getBaseShippingAmountForDiscount();
     } else {
         $shippingAmount = $address->getShippingAmount();
         $baseShippingAmount = $address->getBaseShippingAmount();
     }
     $points_apply = (int) Mage::helper('rewardpoints/event')->getCreditPoints();
     $this->_quote = $quote = $address->getQuote();
     $customer = $quote->getCustomer();
     $customerId = $customer->getId();
     if ($points_apply > 0 && $customerId != null) {
         $points_apply = Mage::helper('rewardpoints/data')->convertMoneyToPoints(Mage::getSingleton('rewardpoints/session')->getDiscountleft());
         $points_apply_amount = Mage::getSingleton('rewardpoints/session')->getDiscountleft();
         if (!$this->_discount) {
             //$reward_model = Mage::getModel('rewardpoints/stats');
             if (Mage::getStoreConfig('rewardpoints/default/flatstats', Mage::app()->getStore()->getId())) {
                 $reward_model = Mage::getModel('rewardpoints/flatstats');
                 $customer_points = $reward_model->collectPointsCurrent($customerId, Mage::app()->getStore()->getId());
             } else {
                 $reward_model = Mage::getModel('rewardpoints/stats');
                 $customer_points = $reward_model->getPointsCurrent($customerId, Mage::app()->getStore()->getId());
             }
             //if ($points_apply > $reward_model->getPointsCurrent($customerId, Mage::app()->getStore()->getId())){
             if ($points_apply > $customer_points) {
                 return false;
             } else {
                 $discounts = $points_apply_amount;
             }
             if (Mage::getSingleton('rewardpoints/session')->getDiscountleft() && (!Mage::getSingleton('rewardpoints/session')->getShippingChecked() && $discounts > 0) || Mage::getSingleton('rewardpoints/session')->getProductChecked() == 0) {
                 Mage::getSingleton('rewardpoints/session')->setShippingChecked(0);
                 Mage::getSingleton('rewardpoints/session')->setDiscountleft($points_apply_amount);
                 $this->_discount = $discounts;
                 $this->_couponCode = $points_apply;
             } else {
                 $this->_discount = Mage::getSingleton('rewardpoints/session')->getDiscountleft();
                 $this->_couponCode = $points_apply;
             }
         }
         $discountAmount = 0;
         $baseDiscountAmount = 0;
         ////////////////////////////
         $discountAmount = min($shippingAmount - $address->getShippingDiscountAmount(), $quote->getStore()->convertPrice($this->_discount));
         $baseDiscountAmount = min($baseShippingAmount - $address->getBaseShippingDiscountAmount(), $this->_discount);
         //$discountAmount = Mage::helper('rewardpoints/data')->ratePointCorrection($discountAmount);
         //$baseDiscountAmount = Mage::helper('rewardpoints/data')->ratePointCorrection($baseDiscountAmount);
         Mage::getSingleton('rewardpoints/session')->setShippingChecked(1);
         //$quote_id = Mage::helper('checkout/cart')->getCart()->getQuote()->getId();
         Mage::getSingleton('rewardpoints/session')->setDiscountleft(Mage::getSingleton('rewardpoints/session')->getDiscountleft() - $baseDiscountAmount);
         $discountAmount = min($discountAmount + $address->getShippingDiscountAmount(), $shippingAmount);
         $baseDiscountAmount = min($baseDiscountAmount + $address->getBaseShippingDiscountAmount(), $baseShippingAmount);
         $address->setShippingDiscountAmount($discountAmount);
         $address->setBaseShippingDiscountAmount($baseDiscountAmount);
     }
 }
开发者ID:xiaoguizhidao,项目名称:devfashion,代码行数:57,代码来源:Discount.php

示例4: collect

 /**
  * Collect totals information about shipping
  *
  * @param   Mage_Sales_Model_Quote_Address $address
  * @return  Mage_Sales_Model_Quote_Address_Total_Shipping
  */
 public function collect(Mage_Sales_Model_Quote_Address $address)
 {
     $_code = 'customshippingrate';
     $method = $address->getShippingMethod();
     if ($method == $_code) {
         $amountPrice = $address->getQuote()->getStore()->convertPrice($address->getBaseShippingAmount(), false);
         if (Mage::helper('customshippingrate')->isMage13()) {
             $address->setShippingAmount($amountPrice);
             $address->setBaseShippingAmount($address->getBaseShippingAmount());
             $address->setGrandTotal($address->getGrandTotal() + $address->getShippingAmount());
             $address->setBaseGrandTotal($address->getBaseGrandTotal() + $address->getBaseShippingAmount());
         } else {
             $this->_setAddress($address);
             $this->_setAmount($amountPrice);
             $this->_setBaseAmount($address->getBaseShippingAmount());
         }
         return $this;
     } else {
         return parent::collect($address);
     }
 }
开发者ID:shebin512,项目名称:Magento_Zoff,代码行数:27,代码来源:Shipping.php

示例5: collect

 public function collect(Mage_Sales_Model_Quote_Address $address)
 {
     $oldWeight = $address->getWeight();
     $address->setWeight(0);
     $address->setShippingAmount(0);
     $method = $address->getShippingMethod();
     $freeAddress = $address->getFreeShipping();
     $address->setFreeMethodWeight(0);
     foreach ($address->getAllItems() as $item) {
         $item->calcRowWeight();
         $address->setWeight($address->getWeight() + $item->getRowWeight());
         if ($freeAddress || $item->getFreeShipping() === true) {
             $item->setRowWeight(0);
         } elseif (is_numeric($item->getFreeShipping())) {
             $origQty = $item->getQty();
             if ($origQty > $item->getFreeShipping()) {
                 $item->setQty($origQty - $item->getFreeShipping());
                 $item->calcRowWeight();
                 $item->setQty($origQty);
             } else {
                 $item->setRowWeight(0);
             }
         }
         $address->setFreeMethodWeight($address->getFreeMethodWeight() + $item->getRowWeight());
     }
     $address->collectShippingRates();
     $address->setShippingAmount(0);
     $address->setBaseShippingAmount(0);
     $method = $address->getShippingMethod();
     if ($method) {
         foreach ($address->getAllShippingRates() as $rate) {
             if ($rate->getCode() == $method) {
                 $amountPrice = $address->getQuote()->getStore()->convertPrice($rate->getPrice(), false);
                 $address->setShippingAmount($amountPrice);
                 $address->setBaseShippingAmount($rate->getPrice());
                 $address->setShippingDescription($rate->getCarrierTitle() . ' - ' . $rate->getMethodDescription());
                 break;
             }
         }
     }
     $address->setGrandTotal($address->getGrandTotal() + $address->getShippingAmount());
     $address->setBaseGrandTotal($address->getBaseGrandTotal() + $address->getBaseShippingAmount());
     return $this;
 }
开发者ID:arslbbt,项目名称:mangentovies,代码行数:44,代码来源:Shipping.php

示例6: collect

 public function collect(Mage_Sales_Model_Quote_Address $address)
 {
     $store = $address->getQuote()->getStore();
     $address->setTaxAmount(0);
     $address->setBaseTaxAmount(0);
     $tax = Mage::getModel('tax/rate_data')->setCustomerClassId($address->getQuote()->getCustomerTaxClassId());
     /* @var $tax Mage_Tax_Model_Rate_Data */
     $taxAddress = $address;
     switch (Mage::getStoreConfig('sales/tax/based_on')) {
         case 'billing':
             $taxAddress = $address->getQuote()->getBillingAddress();
         case 'shipping':
             $tax->setCountryId($taxAddress->getCountryId())->setRegionId($taxAddress->getRegionId())->setPostcode($taxAddress->getPostcode());
             break;
         case 'origin':
             $tax->setCountryId(Mage::getStoreConfig('shipping/origin/country_id', $store))->setRegionId(Mage::getStoreConfig('shipping/origin/region_id', $store))->setPostcode(Mage::getStoreConfig('shipping/origin/postcode', $store));
             break;
     }
     foreach ($address->getAllItems() as $item) {
         $tax->setProductClassId($item->getProduct()->getTaxClassId());
         $rate = $tax->getRate();
         $item->setTaxPercent($rate);
         $item->calcTaxAmount();
         $address->setTaxAmount($address->getTaxAmount() + $item->getTaxAmount());
         $address->setBaseTaxAmount($address->getBaseTaxAmount() + $item->getBaseTaxAmount());
     }
     $shippingTaxClass = Mage::getStoreConfig('sales/tax/shipping_tax_class', $store);
     if ($shippingTaxClass) {
         $tax->setProductClassId($shippingTaxClass);
         if ($rate = $tax->getRate()) {
             $shippingTax = $address->getShippingAmount() * $rate / 100;
             $shippingBaseTax = $address->getBaseShippingAmount() * $rate / 100;
             $shippingTax = $store->roundPrice($shippingTax);
             $shippingBaseTax = $store->roundPrice($shippingBaseTax);
             $address->setTaxAmount($address->getTaxAmount() + $shippingTax);
             $address->setBaseTaxAmount($address->getBaseTaxAmount() + $shippingBaseTax);
         }
     }
     $address->setGrandTotal($address->getGrandTotal() + $address->getTaxAmount());
     $address->setBaseGrandTotal($address->getBaseGrandTotal() + $address->getBaseTaxAmount());
     return $this;
 }
开发者ID:arslbbt,项目名称:mangentovies,代码行数:42,代码来源:Tax.php

示例7: collect


//.........这里部分代码省略.........
     foreach ($items as $item) {
         /**
          * Skip if this item is virtual
          */
         if ($item->getProduct()->isVirtual()) {
             continue;
         }
         /**
          * Children weight we calculate for parent
          */
         if ($item->getParentItem()) {
             continue;
         }
         if ($item->getHasChildren() && $item->isShipSeparately()) {
             foreach ($item->getChildren() as $child) {
                 if ($child->getProduct()->isVirtual()) {
                     continue;
                 }
                 $addressQty += $item->getQty() * $child->getQty();
                 if (!$item->getProduct()->getWeightType()) {
                     $itemWeight = $child->getWeight();
                     $itemQty = $item->getQty() * $child->getQty();
                     $rowWeight = $itemWeight * $itemQty;
                     $addressWeight += $rowWeight;
                     if ($freeAddress || $child->getFreeShipping() === true) {
                         $rowWeight = 0;
                     } elseif (is_numeric($child->getFreeShipping())) {
                         $freeQty = $child->getFreeShipping();
                         if ($itemQty > $freeQty) {
                             $rowWeight = $itemWeight * ($itemQty - $freeQty);
                         } else {
                             $rowWeight = 0;
                         }
                     }
                     $freeMethodWeight += $rowWeight;
                     $item->setRowWeight($rowWeight);
                 }
             }
             if ($item->getProduct()->getWeightType()) {
                 $itemWeight = $item->getWeight();
                 $rowWeight = $itemWeight * $item->getQty();
                 $addressWeight += $rowWeight;
                 if ($freeAddress || $item->getFreeShipping() === true) {
                     $rowWeight = 0;
                 } elseif (is_numeric($item->getFreeShipping())) {
                     $freeQty = $item->getFreeShipping();
                     if ($item->getQty() > $freeQty) {
                         $rowWeight = $itemWeight * ($item->getQty() - $freeQty);
                     } else {
                         $rowWeight = 0;
                     }
                 }
                 $freeMethodWeight += $rowWeight;
                 $item->setRowWeight($rowWeight);
             }
         } else {
             if (!$item->getProduct()->isVirtual()) {
                 $addressQty += $item->getQty();
             }
             $itemWeight = $item->getWeight();
             $rowWeight = $itemWeight * $item->getQty();
             $addressWeight += $rowWeight;
             if ($freeAddress || $item->getFreeShipping() === true) {
                 $rowWeight = 0;
             } elseif (is_numeric($item->getFreeShipping())) {
                 $freeQty = $item->getFreeShipping();
                 if ($item->getQty() > $freeQty) {
                     $rowWeight = $itemWeight * ($item->getQty() - $freeQty);
                 } else {
                     $rowWeight = 0;
                 }
             }
             $freeMethodWeight += $rowWeight;
             $item->setRowWeight($rowWeight);
         }
     }
     if (isset($addressQty)) {
         $address->setItemQty($addressQty);
     }
     $address->setWeight($addressWeight);
     $address->setFreeMethodWeight($freeMethodWeight);
     $address->collectShippingRates();
     $address->setShippingAmount(0);
     $address->setBaseShippingAmount(0);
     $method = $address->getShippingMethod();
     if ($method) {
         foreach ($address->getAllShippingRates() as $rate) {
             if ($rate->getCode() == $method) {
                 $amountPrice = $address->getQuote()->getStore()->convertPrice($rate->getPrice(), false);
                 $address->setShippingAmount($amountPrice);
                 $address->setBaseShippingAmount($rate->getPrice());
                 $address->setShippingDescription($rate->getCarrierTitle() . ' - ' . $rate->getMethodTitle());
                 break;
             }
         }
     }
     $address->setGrandTotal($address->getGrandTotal() + $address->getShippingAmount());
     $address->setBaseGrandTotal($address->getBaseGrandTotal() + $address->getBaseShippingAmount());
     return $this;
 }
开发者ID:ronseigel,项目名称:agent-ohm,代码行数:101,代码来源:Quote_Address_Total_Shipping.php

示例8: handle

 /**
  * @param Mage_Sales_Model_Quote_Address         $address
  * @param Mage_SalesRule_Model_Rule              $rule
  * @param Mage_Sales_Model_Quote_Item_Abstract[] $allItems
  * @param Mage_Sales_Model_Quote_Item_Abstract[] $validItems
  *
  * @return bool
  */
 public function handle(Mage_Sales_Model_Quote_Address $address, Mage_SalesRule_Model_Rule $rule, array $allItems, array $validItems)
 {
     // Skip invalid rule actions
     if ($rule->getSimpleAction() !== Mage_SalesRule_Model_Rule::BY_PERCENT_ACTION) {
         return false;
     }
     // Skip if there are no valid items and it's not applied to shipping
     if (!count($validItems) && !$rule->getApplyToShipping()) {
         return false;
     }
     // Define a few helpful variables
     $helper = $this->getHelper();
     $quote = $address->getQuote();
     $store = $quote->getStore();
     // Get discount percent
     $discountPercent = max(min($rule->getDiscountAmount(), 100.0), 0.0);
     $discountMultiplier = $discountPercent / 100;
     // Skip zero discounts
     if ($discountPercent <= 0.0) {
         return false;
     }
     // Get the discount step size
     $step = max(floatval($rule->getDiscountStep()), 0.0);
     $applied = false;
     foreach ($validItems as $item) {
         // Get max quantity
         $qty = $helper->getItemRuleQty($item, $rule);
         // Apply discount step size limitation
         if ($step > 0.0) {
             $qty = floor($qty / $step) * $step;
         }
         // Skip zero quantities
         if ($qty <= 0.0) {
             continue;
         }
         $applied = true;
         // Get row prices
         $itemRowPrice = $helper->getItemPrice($item) * $qty;
         $itemBaseRowPrice = $helper->getItemBasePrice($item) * $qty;
         $itemOriginalRowPrice = $helper->getItemOriginalPrice($item) * $qty;
         $itemBaseOriginalRowPrice = $helper->getItemBaseOriginalPrice($item) * $qty;
         // Calculate discount amounts
         $discountAmount = ($itemRowPrice - $item->getDiscountAmount()) * $discountMultiplier;
         $baseDiscountAmount = ($itemBaseRowPrice - $item->getBaseDiscountAmount()) * $discountMultiplier;
         $originalDiscountAmount = ($itemOriginalRowPrice - $item->getOriginalDiscountAmount()) * $discountMultiplier;
         $baseOriginalDiscountAmount = ($itemBaseOriginalRowPrice - $item->getBaseOriginalDiscountAmount()) * $discountMultiplier;
         // Round the discount amounts
         $discountAmount = $helper->round($discountAmount, $address->getQuote()->getQuoteCurrencyCode());
         $baseDiscountAmount = $helper->round($baseDiscountAmount, $address->getQuote()->getBaseCurrencyCode());
         $originalDiscountAmount = $helper->round($originalDiscountAmount, $address->getQuote()->getQuoteCurrencyCode());
         $baseOriginalDiscountAmount = $helper->round($baseOriginalDiscountAmount, $address->getQuote()->getBaseCurrencyCode());
         // Update the item discounts
         $item->setDiscountAmount($item->getDiscountAmount() + $discountAmount);
         $item->setBaseDiscountAmount($item->getBaseDiscountAmount() + $baseDiscountAmount);
         $item->setOriginalDiscountAmount($item->getOriginalDiscountAmount() + $originalDiscountAmount);
         $item->setBaseOriginalDiscountAmount($item->getBaseOriginalDiscountAmount() + $baseOriginalDiscountAmount);
         // Update the item percent discount value
         $discountPercent = min(100, $item->getDiscountPercent() + $discountPercent);
         $item->setDiscountPercent($discountPercent);
     }
     if ($rule->getApplyToShipping()) {
         $shippingAmount = $address->getShippingAmountForDiscount();
         $baseShippingAmount = $address->getBaseShippingAmountForDiscount();
         if ($shippingAmount === null || $baseShippingAmount === null) {
             $shippingAmount = $address->getShippingAmount();
             $baseShippingAmount = $address->getBaseShippingAmount();
         }
         // Subtract existing discounts
         $shippingAmount -= $address->getShippingDiscountAmount();
         $baseShippingAmount -= $address->getBaseShippingDiscountAmount();
         // Calculate and round discounts
         $shippingDiscountAmount = $helper->round($shippingAmount * $discountMultiplier, $address->getQuote()->getQuoteCurrencyCode());
         $shippingBaseDiscountAmount = $helper->round($baseShippingAmount * $discountMultiplier, $address->getQuote()->getBaseCurrencyCode());
         // Make sure the discount isn't more that the remaining amount
         $shippingDiscountAmount = min(max($shippingDiscountAmount, 0.0), $shippingAmount);
         $shippingBaseDiscountAmount = min(max($shippingBaseDiscountAmount, 0.0), $baseShippingAmount);
         // Store discounts
         $address->setShippingDiscountAmount($address->getShippingDiscountAmount() + $shippingDiscountAmount);
         $address->setBaseShippingDiscountAmount($address->getBaseShippingDiscountAmount() + $shippingBaseDiscountAmount);
         $applied = true;
     }
     return $applied;
 }
开发者ID:aoepeople,项目名称:aoe_salesrule,代码行数:91,代码来源:ByPercent.php

示例9: _addShipping

 /**
  * Adds shipping cost to request as item
  *
  * @param Mage_Sales_Model_Quote_Address $address
  * @return int
  */
 protected function _addShipping($address)
 {
     $lineNumber = $this->_getNewLineCode();
     $storeId = $address->getQuote()->getStore()->getId();
     $taxClass = Mage::helper('tax')->getShippingTaxClass($storeId);
     $shippingAmount = max(0.0, (double) $address->getBaseShippingAmount());
     if ($this->_getTaxDataHelper()->applyTaxAfterDiscount($storeId)) {
         $shippingAmount -= (double) $address->getBaseShippingDiscountAmount();
     }
     $line = $this->_getNewDocumentRequestLineObject();
     $line->setLineCode($lineNumber);
     $shippingSku = $this->_getConfigHelper()->getShippingSku($storeId);
     $line->setItemCode($shippingSku ?: self::DEFAULT_SHIPPING_ITEMS_SKU);
     $line->setItemDescription(self::DEFAULT_SHIPPING_ITEMS_DESCRIPTION);
     $line->setAvalaraGoodsAndServicesType($taxClass);
     $line->setNumberOfItems(1);
     $line->setlineAmount($shippingAmount);
     $discounted = (double) $address->getBaseShippingDiscountAmount() && $this->_getTaxDataHelper()->applyTaxAfterDiscount($storeId) ? 'true' : 'false';
     $line->setDiscounted($discounted);
     if ($this->_getTaxDataHelper()->shippingPriceIncludesTax($storeId)) {
         $line->setTaxIncluded('true');
     }
     $this->_lines[$lineNumber] = $line;
     $this->_setLinesToRequest();
     $this->_lineToLineId[$lineNumber] = $shippingSku;
     return $lineNumber;
 }
开发者ID:onepica,项目名称:avatax,代码行数:33,代码来源:Estimate.php

示例10: _calculateShippingTax

 /**
  * Tax caclulation for shipping price
  *
  * @param   Mage_Sales_Model_Quote_Address $address
  * @param   Varien_Object $taxRateRequest
  * @return  Mage_Tax_Model_Sales_Total_Quote
  */
 protected function _calculateShippingTax(Mage_Sales_Model_Quote_Address $address, $taxRateRequest)
 {
     $store = $address->getQuote()->getStore();
     $shippingTaxClass = $this->_config->getShippingTaxClass($store);
     $shippingAmount = $address->getShippingAmount();
     $baseShippingAmount = $address->getBaseShippingAmount();
     $shippingDiscountAmount = $address->getShippingDiscountAmount();
     $baseShippingDiscountAmount = $address->getBaseShippingDiscountAmount();
     /**
      * Subtract discount before calculate tax amount
      */
     if ($this->_config->applyTaxAfterDiscount($store)) {
         $calcAmount = $shippingAmount - $shippingDiscountAmount;
         $baseCalcAmount = $baseShippingAmount - $baseShippingDiscountAmount;
     } else {
         $calcAmount = $shippingAmount;
         $baseCalcAmount = $baseShippingAmount;
     }
     $shippingTax = 0;
     $shippingBaseTax = 0;
     if ($shippingTaxClass) {
         $taxRateRequest->setProductClassId($shippingTaxClass);
         $rate = $this->_calculator->getRate($taxRateRequest);
         if ($rate) {
             if ($this->_config->shippingPriceIncludesTax($store) && $this->_areTaxRequestsSimilar) {
                 $shippingTax = $this->_calculator->calcTaxAmount($calcAmount, $rate, true, false);
                 $shippingBaseTax = $this->_calculator->calcTaxAmount($baseCalcAmount, $rate, true, false);
                 $shippingAmount -= $shippingTax;
                 $baseShippingAmount -= $shippingBaseTax;
             } else {
                 $shippingTax = $this->_calculator->calcTaxAmount($calcAmount, $rate, false, false);
                 $shippingBaseTax = $this->_calculator->calcTaxAmount($baseCalcAmount, $rate, false, false);
             }
             $rateKey = (string) $rate;
             if (isset($this->_roundingDeltas[$rateKey])) {
                 $shippingTax += $this->_roundingDeltas[$rateKey];
             }
             if (isset($this->_baseRoundingDeltas[$rateKey])) {
                 $shippingBaseTax += $this->_baseRoundingDeltas[$rateKey];
             }
             $shippingTax = $this->_calculator->round($shippingTax);
             $shippingBaseTax = $this->_calculator->round($shippingBaseTax);
             $address->setTotalAmount('shipping', $shippingAmount);
             $address->setBaseTotalAmount('shipping', $baseShippingAmount);
             /**
              * Provide additional attributes for apply discount on price include tax
              */
             if ($this->_config->discountTax($store)) {
                 $address->setShippingAmountForDiscount($shippingAmount + $shippingTax);
                 $address->setBaseShippingAmountForDiscount($baseShippingAmount + $shippingBaseTax);
             }
             $this->_addAmount($shippingTax);
             $this->_addBaseAmount($shippingBaseTax);
             $applied = $this->_calculator->getAppliedRates($taxRateRequest);
             $this->_saveAppliedTaxes($address, $applied, $shippingTax, $shippingBaseTax, $rate);
         }
     }
     $address->setShippingTaxAmount($shippingTax);
     $address->setBaseShippingTaxAmount($shippingBaseTax);
     return $this;
 }
开发者ID:hunnybohara,项目名称:magento-chinese-localization,代码行数:68,代码来源:Tax.php

示例11: handle

 /**
  * @param Mage_Sales_Model_Quote_Address         $address
  * @param Mage_SalesRule_Model_Rule              $rule
  * @param Mage_Sales_Model_Quote_Item_Abstract[] $allItems
  * @param Mage_Sales_Model_Quote_Item_Abstract[] $validItems
  *
  * @return bool
  */
 public function handle(Mage_Sales_Model_Quote_Address $address, Mage_SalesRule_Model_Rule $rule, array $allItems, array $validItems)
 {
     // Skip invalid rule actions
     if ($rule->getSimpleAction() !== Mage_SalesRule_Model_Rule::BY_FIXED_ACTION) {
         return false;
     }
     // Skip if there are no valid items and it's not applied to shipping
     if (!count($validItems) && !$rule->getApplyToShipping()) {
         return false;
     }
     // Define a few helpful variables
     $helper = $this->getHelper();
     $quote = $address->getQuote();
     $store = $quote->getStore();
     // Discount amount
     $baseDiscountAmount = $helper->round($rule->getDiscountAmount(), $quote->getBaseCurrencyCode());
     $discountAmount = $helper->round($store->convertPrice($baseDiscountAmount), $quote->getQuoteCurrencyCode());
     // Skip zero discounts
     if ($discountAmount <= 0.0) {
         return false;
     }
     // Get the discount step size
     $step = max(floatval($rule->getDiscountStep()), 0.0);
     $applied = false;
     foreach ($validItems as $item) {
         // Get max quantity
         $qty = $helper->getItemRuleQty($item, $rule);
         // Apply discount step size limitation
         if ($step > 0.0) {
             $qty = floor($qty / $step) * $step;
         }
         // Skip zero quantities
         if ($qty <= 0.0) {
             continue;
         }
         $applied = true;
         // Calculate discount amounts
         $discountAmount = $discountAmount * $qty;
         $baseDiscountAmount = $baseDiscountAmount * $qty;
         $originalDiscountAmount = $discountAmount * $qty;
         $baseOriginalDiscountAmount = $baseDiscountAmount * $qty;
         // Round the discount amounts
         $discountAmount = $helper->round($discountAmount, $address->getQuote()->getQuoteCurrencyCode());
         $baseDiscountAmount = $helper->round($baseDiscountAmount, $address->getQuote()->getBaseCurrencyCode());
         $originalDiscountAmount = $helper->round($originalDiscountAmount, $address->getQuote()->getQuoteCurrencyCode());
         $baseOriginalDiscountAmount = $helper->round($baseOriginalDiscountAmount, $address->getQuote()->getBaseCurrencyCode());
         // Update the item discounts
         $item->setDiscountAmount($item->getDiscountAmount() + $discountAmount);
         $item->setBaseDiscountAmount($item->getBaseDiscountAmount() + $baseDiscountAmount);
         $item->setOriginalDiscountAmount($item->getOriginalDiscountAmount() + $originalDiscountAmount);
         $item->setBaseOriginalDiscountAmount($item->getBaseOriginalDiscountAmount() + $baseOriginalDiscountAmount);
     }
     if ($rule->getApplyToShipping()) {
         $shippingAmount = $address->getShippingAmountForDiscount();
         $baseShippingAmount = $address->getBaseShippingAmountForDiscount();
         if ($shippingAmount === null || $baseShippingAmount === null) {
             $shippingAmount = $address->getShippingAmount();
             $baseShippingAmount = $address->getBaseShippingAmount();
         }
         $shippingAmount -= $address->getShippingDiscountAmount();
         $baseShippingAmount -= $address->getBaseShippingDiscountAmount();
         $shippingDiscountAmount = min(max($discountAmount, 0.0), $shippingAmount);
         $shippingBaseDiscountAmount = min(max($baseDiscountAmount, 0.0), $baseShippingAmount);
         $address->setShippingDiscountAmount($address->getShippingDiscountAmount() + $shippingDiscountAmount);
         $address->setBaseShippingDiscountAmount($address->getBaseShippingDiscountAmount() + $shippingBaseDiscountAmount);
         $applied = true;
     }
     return $applied;
 }
开发者ID:aoepeople,项目名称:aoe_salesrule,代码行数:77,代码来源:ByFixed.php

示例12: processShippingAmount

 /**
  * Apply discounts to shipping amount
  *
  * @param   Mage_Sales_Model_Quote_Address $address
  * @return  Mage_SalesRule_Model_Validator
  */
 public function processShippingAmount(Mage_Sales_Model_Quote_Address $address)
 {
     $shippingAmount = $address->getShippingAmountForDiscount();
     if ($shippingAmount !== null) {
         $baseShippingAmount = $address->getBaseShippingAmountForDiscount();
     } else {
         $shippingAmount = $address->getShippingAmount();
         $baseShippingAmount = $address->getBaseShippingAmount();
     }
     $quote = $address->getQuote();
     $appliedRuleIds = array();
     foreach ($this->_getRules() as $rule) {
         /* @var $rule Mage_SalesRule_Model_Rule */
         if (!$rule->getApplyToShipping() || !$this->_canProcessRule($rule, $address)) {
             continue;
         }
         // WDCA BEGIN
         //@nelkaake -a 16/11/10:
         $points_rule = $this->getRule($rule->getId());
         if ($points_rule->isPointsRule()) {
             if ($points_rule->getPointsAction() == TBT_Rewards_Model_Salesrule_Actions::ACTION_DISCOUNT_BY_POINTS_SPENT) {
                 $rule->setDiscountAmount(0);
             }
         }
         // WDCA END
         $discountAmount = 0;
         $baseDiscountAmount = 0;
         $rulePercent = min(100, $rule->getDiscountAmount());
         switch ($rule->getSimpleAction()) {
             case 'to_percent':
                 $rulePercent = max(0, 100 - $rule->getDiscountAmount());
             case 'by_percent':
                 $discountAmount = ($shippingAmount - $address->getShippingDiscountAmount()) * $rulePercent / 100;
                 $baseDiscountAmount = ($baseShippingAmount - $address->getBaseShippingDiscountAmount()) * $rulePercent / 100;
                 $discountPercent = min(100, $address->getShippingDiscountPercent() + $rulePercent);
                 $address->setShippingDiscountPercent($discountPercent);
                 break;
             case 'to_fixed':
                 $quoteAmount = $quote->getStore()->convertPrice($rule->getDiscountAmount());
                 $discountAmount = $shippingAmount - $quoteAmount;
                 $baseDiscountAmount = $baseShippingAmount - $rule->getDiscountAmount();
                 break;
             case 'by_fixed':
                 $quoteAmount = $quote->getStore()->convertPrice($rule->getDiscountAmount());
                 $discountAmount = $quoteAmount;
                 $baseDiscountAmount = $rule->getDiscountAmount();
                 break;
             case 'cart_fixed':
                 //@nelkaake -a 26/01/11: To resolve an issue with Magento 1.4.2 and the shipping discounts, we have to keep
                 // track of the cart fixed discounts separately from the old way that no longer works with Magento 1.4.2
                 // as well as the new way with Magento 1.4.2.  getCartFixedRules2 is the old way as stored by
                 // the recalculateDiscount function above.  That's what you see on the next 5 lines.
                 if (Mage::helper('rewards')->isBaseMageVersionAtLeast('1.4.2')) {
                     $cartRules = $address->getCartFixedRules2();
                 } else {
                     $cartRules = $address->getCartFixedRules();
                 }
                 if (!isset($cartRules[$rule->getId()])) {
                     $cartRules[$rule->getId()] = $rule->getDiscountAmount();
                 }
                 if ($cartRules[$rule->getId()] > 0) {
                     $quoteAmount = $quote->getStore()->convertPrice($cartRules[$rule->getId()]);
                     $discountAmount = min($shippingAmount - $address->getShippingDiscountAmount(), $quoteAmount);
                     $baseDiscountAmount = min($baseShippingAmount - $address->getBaseShippingDiscountAmount(), $cartRules[$rule->getId()]);
                     $cartRules[$rule->getId()] -= $baseDiscountAmount;
                 }
                 $address->setCartFixedRules($cartRules);
                 break;
         }
         $discountAmount = min($address->getShippingDiscountAmount() + $discountAmount, $shippingAmount);
         $baseDiscountAmount = min($address->getBaseShippingDiscountAmount() + $baseDiscountAmount, $baseShippingAmount);
         $address->setShippingDiscountAmount($discountAmount);
         $address->setBaseShippingDiscountAmount($baseDiscountAmount);
         $appliedRuleIds[$rule->getRuleId()] = $rule->getRuleId();
         $this->_maintainAddressCouponCode($address, $rule);
         $this->_addDiscountDescription($address, $rule);
         if ($rule->getStopRulesProcessing()) {
             break;
         }
     }
     $address->setAppliedRuleIds($this->mergeIds($address->getAppliedRuleIds(), $appliedRuleIds));
     $quote->setAppliedRuleIds($this->mergeIds($quote->getAppliedRuleIds(), $appliedRuleIds));
     return $this;
 }
开发者ID:rajarshc,项目名称:Rooja,代码行数:90,代码来源:Validator.php

示例13: _updateEarningPoints

 /**
  * update earning points for address items
  * 
  * @param Mage_Sales_Model_Quote_Address $address
  * @return Magestore_RewardPoints_Model_Total_Quote_Earning
  */
 protected function _updateEarningPoints($address)
 {
     $items = $address->getAllItems();
     $earningPoints = $address->getRewardpointsEarn();
     if (!count($items) || $earningPoints <= 0) {
         return $this;
     }
     // Calculate total item prices
     $baseItemsPrice = 0;
     $totalItemsQty = 0;
     $isBaseOnQty = false;
     foreach ($items as $item) {
         if ($item->getParentItemId()) {
             continue;
         }
         if ($item->getHasChildren() && $item->isChildrenCalculated()) {
             foreach ($item->getChildren() as $child) {
                 $baseItemsPrice += $item->getQty() * ($child->getQty() * $child->getBasePriceInclTax() - $child->getBaseDiscountAmount());
                 $totalItemsQty += $item->getQty() * $child->getQty();
             }
         } elseif ($item->getProduct()) {
             $baseItemsPrice += $item->getQty() * $item->getBasePriceInclTax() - $item->getBaseDiscountAmount();
             $totalItemsQty += $item->getQty();
         }
     }
     $baseItemsPrice += $address->getBaseShippingAmount() + $address->getBaseShippingTaxAmount();
     if ($baseItemsPrice < 0.0001) {
         $isBaseOnQty = true;
     }
     // Update for items
     foreach ($items as $item) {
         if ($item->getParentItemId()) {
             continue;
         }
         if ($item->getHasChildren() && $item->isChildrenCalculated()) {
             foreach ($item->getChildren() as $child) {
                 $baseItemPrice = $item->getQty() * ($child->getQty() * $child->getBasePriceInclTax() - $child->getBaseDiscountAmount());
                 $itemQty = $item->getQty() * $child->getQty();
                 if ($isBaseOnQty) {
                     $itemEarning = round($itemQty * $earningPoints / $totalItemsQty, 0, PHP_ROUND_HALF_DOWN);
                 } else {
                     $itemEarning = round($baseItemPrice * $earningPoints / $baseItemsPrice, 0, PHP_ROUND_HALF_DOWN);
                 }
                 $child->setRewardpointsEarn($itemEarning);
             }
         } elseif ($item->getProduct()) {
             $baseItemPrice = $item->getQty() * $item->getBasePriceInclTax() - $item->getBaseDiscountAmount();
             $itemQty = $item->getQty();
             if ($isBaseOnQty) {
                 $itemEarning = round($itemQty * $earningPoints / $totalItemsQty, 0, PHP_ROUND_HALF_DOWN);
             } else {
                 $itemEarning = round($baseItemPrice * $earningPoints / $baseItemsPrice, 0, PHP_ROUND_HALF_DOWN);
             }
             $item->setRewardpointsEarn($itemEarning);
         }
     }
     return $this;
 }
开发者ID:kanotest15,项目名称:cbmagento,代码行数:64,代码来源:Earning.php

示例14: handle

 /**
  * @param Mage_Sales_Model_Quote_Address         $address
  * @param Mage_SalesRule_Model_Rule              $rule
  * @param Mage_Sales_Model_Quote_Item_Abstract[] $allItems
  * @param Mage_Sales_Model_Quote_Item_Abstract[] $validItems
  *
  * @return bool
  */
 public function handle(Mage_Sales_Model_Quote_Address $address, Mage_SalesRule_Model_Rule $rule, array $allItems, array $validItems)
 {
     // Skip invalid rule actions
     if ($rule->getSimpleAction() !== Mage_SalesRule_Model_Rule::CART_FIXED_ACTION) {
         return false;
     }
     // Skip if there are no valid items and it's not applied to shipping
     if (!count($validItems) && !$rule->getApplyToShipping()) {
         return false;
     }
     // Define a few helpful variables
     $helper = $this->getHelper();
     $quote = $address->getQuote();
     $store = $quote->getStore();
     // Total available discount amounts
     $baseDiscountAmount = $helper->round($rule->getDiscountAmount(), $quote->getBaseCurrencyCode());
     $discountAmount = $helper->round($store->convertPrice($baseDiscountAmount), $quote->getQuoteCurrencyCode());
     // Skip zero discounts
     if ($discountAmount <= 0.0) {
         return false;
     }
     $applied = false;
     // Pre-calculate the totals for all valid items
     $ruleTotalItemsPrice = 0;
     $ruleTotalBaseItemsPrice = 0;
     $itemPrices = [];
     foreach ($validItems as $item) {
         // Get max quantity (min or rule max qty or item qty)
         $qty = $helper->getItemRuleQty($item, $rule);
         // Skip zero quantity
         if ($qty <= 0.0) {
             continue;
         }
         // Get unit price
         $itemPrice = $helper->getItemPrice($item);
         $itemBasePrice = $helper->getItemBasePrice($item);
         // Get row price
         $itemRowPrice = $itemPrice * $item->getTotalQty();
         $itemBaseRowPrice = $itemBasePrice * $item->getTotalQty();
         // Get discountable price
         $itemDiscountablePrice = $itemPrice * $qty;
         $itemBaseDiscountablePrice = $itemBasePrice * $qty;
         // Save price data for later
         $itemPrices[$item->getId()] = [$itemPrice, $itemBasePrice, $itemRowPrice, $itemBaseRowPrice, $itemDiscountablePrice, $itemBaseDiscountablePrice];
         // Add row prices to running totals
         $ruleTotalItemsPrice += $itemDiscountablePrice;
         $ruleTotalBaseItemsPrice += $itemBaseDiscountablePrice;
     }
     $startDiscountAmount = $discountAmount;
     $startBaseDiscountAmount = $baseDiscountAmount;
     foreach ($validItems as $item) {
         // Skip the skipped items
         if (!isset($itemPrices[$item->getId()])) {
             continue;
         }
         // Flag indicating the rule was applied
         $applied = true;
         // Extract the pre-calculate price data
         list($itemPrice, $itemBasePrice, $itemRowPrice, $itemBaseRowPrice, $itemDiscountablePrice, $itemBaseDiscountablePrice) = $itemPrices[$item->getId()];
         // Calculate remaining row amount
         $itemRemainingRowPrice = max($itemRowPrice - $item->getDiscountAmount(), 0);
         $itemRemainingBaseRowPrice = max($itemBaseRowPrice - $item->getBaseDiscountAmount(), 0);
         // Calculate price factor
         $priceFactor = $itemDiscountablePrice / $ruleTotalItemsPrice;
         $basePriceFactor = $itemBaseDiscountablePrice / $ruleTotalBaseItemsPrice;
         // Calculate (and round) the item discount amount
         $itemDiscountAmount = $helper->round($startDiscountAmount * $priceFactor, $quote->getQuoteCurrencyCode());
         $itemBaseDiscountAmount = $helper->round($startBaseDiscountAmount * $basePriceFactor, $quote->getBaseCurrencyCode());
         // Ensure discount does not exceed the remaining discount, max item discount, or remaining row price
         $itemDiscountAmount = max(min($itemDiscountAmount, $discountAmount, $itemDiscountablePrice, $itemRemainingRowPrice), 0.0);
         $itemBaseDiscountAmount = max(min($itemBaseDiscountAmount, $baseDiscountAmount, $itemBaseDiscountablePrice, $itemRemainingBaseRowPrice), 0.0);
         // Update the item discount
         $item->setDiscountAmount($item->getDiscountAmount() + $itemDiscountAmount);
         $item->setBaseDiscountAmount($item->getBaseDiscountAmount() + $itemBaseDiscountAmount);
         // This is a bit wonky, but needed for taxes
         $item->setOriginalDiscountAmount($item->getOriginalDiscountAmount() + $itemDiscountAmount);
         $item->setBaseOriginalDiscountAmount($item->getBaseOriginalDiscountAmount() + $itemBaseDiscountAmount);
         // Subtract from the total remaining discount amount
         $discountAmount -= $itemDiscountAmount;
         $baseDiscountAmount -= $itemBaseDiscountAmount;
     }
     if ($rule->getApplyToShipping()) {
         $shippingAmount = $address->getShippingAmountForDiscount();
         $baseShippingAmount = $address->getBaseShippingAmountForDiscount();
         if ($shippingAmount === null || $baseShippingAmount === null) {
             $shippingAmount = $address->getShippingAmount();
             $baseShippingAmount = $address->getBaseShippingAmount();
         }
         $shippingAmount -= $address->getShippingDiscountAmount();
         $baseShippingAmount -= $address->getBaseShippingDiscountAmount();
         $shippingDiscountAmount = max(min($discountAmount, $shippingAmount), 0.0);
         $shippingBaseDiscountAmount = max(min($baseDiscountAmount, $baseShippingAmount), 0.0);
//.........这里部分代码省略.........
开发者ID:aoepeople,项目名称:aoe_salesrule,代码行数:101,代码来源:CartFixed.php

示例15: _prepareDiscountForTaxAmount

 /**
  * Prepare Discount Amount used for Tax
  * 
  * @param Mage_Sales_Model_Quote_Address $address
  * @param type $baseDiscount
  * @return Magestore_RewardPoints_Model_Total_Quote_Point
  */
 public function _prepareDiscountForTaxAmount(Mage_Sales_Model_Quote_Address $address, $baseDiscount, $points)
 {
     $items = $address->getAllItems();
     if (!count($items)) {
         return $this;
     }
     // Calculate total item prices
     $baseItemsPrice = 0;
     foreach ($items as $item) {
         if ($item->getParentItemId()) {
             continue;
         }
         if ($item->getHasChildren() && $item->isChildrenCalculated()) {
             foreach ($item->getChildren() as $child) {
                 $baseItemsPrice += $item->getQty() * ($child->getQty() * $child->getBasePrice() - $child->getBaseDiscountAmount() + $child->getBaseTaxAmount());
             }
         } elseif ($item->getProduct()) {
             $baseItemsPrice += $item->getQty() * $item->getBasePrice() - $item->getBaseDiscountAmount() - $item->getRewardpointsBaseDiscount() + $item->getBaseTaxAmount();
         }
     }
     $discountForShipping = Mage::getStoreConfig(Magestore_RewardPoints_Helper_Calculation_Spending::XML_PATH_SPEND_FOR_SHIPPING, $address->getQuote()->getStoreId());
     $discountForShippingTax = Mage::getStoreConfig(Magestore_RewardPoints_Helper_Calculation_Spending::XML_PATH_SPEND_FOR_SHIPPING_TAX, $address->getQuote()->getStoreId());
     if ($discountForShipping) {
         $baseItemsPrice += $address->getBaseShippingAmount();
         if ($discountForShippingTax) {
             $baseItemsPrice += $address->getBaseShippingTaxAmount();
         }
     }
     if ($baseItemsPrice < 0.0001) {
         return $this;
     }
     // Update discount for each item
     foreach ($items as $item) {
         if ($item->getParentItemId()) {
             continue;
         }
         if ($item->getHasChildren() && $item->isChildrenCalculated()) {
             foreach ($item->getChildren() as $child) {
                 $baseItemPrice = $item->getQty() * ($child->getQty() * $child->getBasePrice() - $child->getBaseDiscountAmount() + $child->getBaseTaxAmount());
                 $itemBaseDiscount = $baseDiscount * $baseItemPrice / $baseItemsPrice;
                 $itemDiscount = Mage::app()->getStore()->convertPrice($itemBaseDiscount);
                 $pointSpent = round($points * $baseItemPrice / $baseItemsPrice, 0, PHP_ROUND_HALF_DOWN);
                 $child->setRewardpointsBaseDiscount($child->getRewardpointsBaseDiscount() + $itemBaseDiscount)->setRewardpointsDiscount($child->getRewardpointsDiscount() + $itemDiscount)->setMagestoreBaseDiscount($child->getMagestoreBaseDiscount() + $itemBaseDiscount)->setRewardpointsSpent($child->getRewardpointsSpent() + $pointSpent);
             }
         } elseif ($item->getProduct()) {
             $baseItemPrice = $item->getQty() * $item->getBasePrice() - $item->getBaseDiscountAmount() - $item->getRewardpointsBaseDiscount() + $item->getBaseTaxAmount();
             $itemBaseDiscount = $baseDiscount * $baseItemPrice / $baseItemsPrice;
             $itemDiscount = Mage::app()->getStore()->convertPrice($itemBaseDiscount);
             $pointSpent = round($points * $baseItemPrice / $baseItemsPrice, 0, PHP_ROUND_HALF_DOWN);
             $item->setRewardpointsBaseDiscount($item->getRewardpointsBaseDiscount() + $itemBaseDiscount)->setRewardpointsDiscount($item->getRewardpointsDiscount() + $itemDiscount)->setMagestoreBaseDiscount($item->getMagestoreBaseDiscount() + $itemBaseDiscount)->setRewardpointsSpent($item->getRewardpointsSpent() + $pointSpent);
         }
     }
     if ($discountForShipping) {
         $shipping = $address->getBaseShippingAmount();
         if ($discountForShippingTax) {
             $shipping += $address->getBaseShippingTaxAmount();
         }
         $itemBaseDiscount = $baseDiscount * $shipping / $baseItemsPrice;
         $itemDiscount = Mage::app()->getStore()->convertPrice($itemBaseDiscount);
         $address->setRewardpointsBaseAmount($itemBaseDiscount)->setMagestoreBaseDiscountForShipping($itemBaseDiscount)->setRewardpointsAmount($itemDiscount);
     }
     return $this;
 }
开发者ID:kanotest15,项目名称:cbmagento,代码行数:70,代码来源:Pointaftertax.php


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