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


PHP Mage_Sales_Model_Quote_Address::setBaseGrandTotal方法代码示例

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


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

示例1: collect

 /**
  * Collect giftcertificate totals for specified address
  *
  * @param Mage_Sales_Model_Quote_Address $address
  */
 public function collect(Mage_Sales_Model_Quote_Address $address)
 {
     $this->_collectQuoteGiftCards($address->getQuote());
     $baseAmountLeft = $address->getQuote()->getBaseGiftCardsAmount() - $address->getQuote()->getBaseGiftCardsAmountUsed();
     $amountLeft = $address->getQuote()->getGiftCardsAmount() - $address->getQuote()->getGiftCardsAmountUsed();
     $baseTotalUsed = $totalUsed = $baseUsed = $used = $skipped = $baseSaved = $saved = 0;
     if ($baseAmountLeft >= $address->getBaseGrandTotal()) {
         $baseUsed = $address->getBaseGrandTotal();
         $used = $address->getGrandTotal();
         $address->setBaseGrandTotal(0);
         $address->setGrandTotal(0);
     } else {
         $baseUsed = $baseAmountLeft;
         $used = $amountLeft;
         $address->setBaseGrandTotal($address->getBaseGrandTotal() - $baseAmountLeft);
         $address->setGrandTotal($address->getGrandTotal() - $amountLeft);
     }
     $addressCards = array();
     $usedAddressCards = array();
     if ($baseUsed) {
         $quoteCards = $this->_sortGiftCards(Mage::helper('enterprise_giftcardaccount')->getCards($address->getQuote()));
         foreach ($quoteCards as $quoteCard) {
             $card = $quoteCard;
             if ($quoteCard['ba'] + $skipped <= $address->getQuote()->getBaseGiftCardsAmountUsed()) {
                 $baseThisCardUsedAmount = $thisCardUsedAmount = 0;
             } elseif ($quoteCard['ba'] + $baseSaved > $baseUsed) {
                 $baseThisCardUsedAmount = min($quoteCard['ba'], $baseUsed - $baseSaved);
                 $thisCardUsedAmount = min($quoteCard['a'], $used - $saved);
                 $baseSaved += $baseThisCardUsedAmount;
                 $saved += $thisCardUsedAmount;
             } elseif ($quoteCard['ba'] + $skipped + $baseSaved > $address->getQuote()->getBaseGiftCardsAmountUsed()) {
                 $baseThisCardUsedAmount = min($quoteCard['ba'], $baseUsed);
                 $thisCardUsedAmount = min($quoteCard['a'], $used);
                 $baseSaved += $baseThisCardUsedAmount;
                 $saved += $thisCardUsedAmount;
             } else {
                 $baseThisCardUsedAmount = $thisCardUsedAmount = 0;
             }
             // avoid possible errors in future comparisons
             $card['ba'] = round($baseThisCardUsedAmount, 4);
             $card['a'] = round($thisCardUsedAmount, 4);
             $addressCards[] = $card;
             if ($baseThisCardUsedAmount) {
                 $usedAddressCards[] = $card;
             }
             $skipped += $quoteCard['ba'];
         }
     }
     Mage::helper('enterprise_giftcardaccount')->setCards($address, $usedAddressCards);
     $address->setUsedGiftCards($address->getGiftCards());
     Mage::helper('enterprise_giftcardaccount')->setCards($address, $addressCards);
     $baseTotalUsed = $address->getQuote()->getBaseGiftCardsAmountUsed() + $baseUsed;
     $totalUsed = $address->getQuote()->getGiftCardsAmountUsed() + $used;
     $address->getQuote()->setBaseGiftCardsAmountUsed($baseTotalUsed);
     $address->getQuote()->setGiftCardsAmountUsed($totalUsed);
     $address->setBaseGiftCardsAmount($baseUsed);
     $address->setGiftCardsAmount($used);
     return $this;
 }
开发者ID:QiuLihua83,项目名称:magento-enterprise-1.13.1.0,代码行数:64,代码来源:Giftcardaccount.php

示例2: collect

 public function collect(Mage_Sales_Model_Quote_Address $address)
 {
     $quote = $address->getQuote();
     $session = Mage::getSingleton('checkout/session');
     if (is_null($session->getQuoteId())) {
         $session = Mage::getSingleton('adminhtml/session_quote');
     }
     $isCustomerLoggedIn = (bool) $quote->getCustomer()->getId();
     if ($session->getData('use_points') && $address->getBaseGrandTotal() && $isCustomerLoggedIn) {
         $customer = Mage::getModel('customer/customer')->load($quote->getCustomer()->getId());
         $pointsAmountUsed = abs($session->getData('points_amount'));
         $pointsAmountAllowed = Mage::getModel('points/summary')->loadByCustomer($customer)->getPoints();
         $storeId = $session->getQuote()->getStoreId();
         $website = Mage::app()->getWebsite(Mage::app()->getStore($storeId)->getWebsiteId());
         $baseSubtotalWithDiscount = $address->getData('base_subtotal') + $address->getData('base_discount_amount');
         $subtotalWithDiscount = $address->getData('subtotal') + $address->getData('discount_amount');
         $pointsSpendingCalculation = Mage::helper('points/config')->getPointsSpendingCalculation();
         if ($pointsSpendingCalculation !== AW_Points_Helper_Config::BEFORE_TAX) {
             $baseSubtotalWithDiscount += $address->getData('base_tax_amount');
             $subtotalWithDiscount += $address->getData('tax_amount');
         }
         $limitedPoints = Mage::helper('points')->getLimitedPoints($baseSubtotalWithDiscount, $customer, $storeId);
         $pointsAmountUsed = min($pointsAmountUsed, $pointsAmountAllowed, $limitedPoints);
         $session->setData('points_amount', $pointsAmountUsed);
         $rate = Mage::getModel('points/rate')->setCurrentCustomer($customer)->setCurrentWebsite($website)->loadByDirection(AW_Points_Model_Rate::POINTS_TO_CURRENCY);
         if (!$rate->getId()) {
             return $this;
         }
         $moneyBaseCurrencyForPoints = $rate->exchange($pointsAmountUsed);
         $moneyCurrentCurrencyForPoints = Mage::app()->getStore()->convertPrice($moneyBaseCurrencyForPoints);
         /**
          * If points amount is more then needed to pay for subtotal with discount for order,
          * we need to set new points amount
          */
         if ($moneyBaseCurrencyForPoints > $baseSubtotalWithDiscount) {
             $neededAmount = ceil($baseSubtotalWithDiscount * $rate->getPoints() / $rate->getMoney());
             $neededAmountBaseCurrency = $rate->exchange($neededAmount);
             $neededAmountCurrentCurrency = Mage::app()->getStore()->convertPrice($neededAmountBaseCurrency);
             $session->setData('points_amount', $neededAmount);
             $address->setGrandTotal($address->getData('grand_total') - $subtotalWithDiscount);
             $address->setBaseGrandTotal($address->getData('base_grand_total') - $baseSubtotalWithDiscount);
             $address->setMoneyForPoints($neededAmountCurrentCurrency);
             $address->setBaseMoneyForPoints($neededAmountBaseCurrency);
             $quote->setMoneyForPoints($neededAmountCurrentCurrency);
             $quote->setBaseMoneyForPoints($neededAmountBaseCurrency);
         } else {
             $address->setGrandTotal($address->getGrandTotal() - $moneyCurrentCurrencyForPoints);
             $address->setBaseGrandTotal($address->getBaseGrandTotal() - $moneyBaseCurrencyForPoints);
             $address->setMoneyForPoints($moneyCurrentCurrencyForPoints);
             $address->setBaseMoneyForPoints($moneyBaseCurrencyForPoints);
             $quote->setMoneyForPoints($moneyCurrentCurrencyForPoints);
             $quote->setBaseMoneyForPoints($moneyBaseCurrencyForPoints);
         }
     }
     return $this;
 }
开发者ID:HPTTeam,项目名称:hackathon,代码行数:56,代码来源:Points.php

示例3: collect

 public function collect(Mage_Sales_Model_Quote_Address $address)
 {
     if ($address->getData('address_type') == 'billing') {
         return $this;
     }
     // Fetch if "Store Credit" was applied by checking if "store_credit" session is not empty.
     $raw = (double) $this->_getSession()->getData('store_credit');
     if (!$raw) {
         return $this;
     }
     /* START: Perform a re-check / validation in the credit's session.
      * This will ensure that session has 
      * */
     if (($customer_id = $this->_getSession()->getId()) > 0) {
         list($read, $write) = $this->_getResource();
         $sql = "SELECT credit_remaining FROM storecredit WHERE customer_id='" . $customer_id . "'";
         $credit_remaining = (double) $read->fetchOne($sql);
         if ($credit_remaining >= $raw) {
             /* $credit_remaining must be always greater or equal than $raw (credit to use). */
         } else {
             return $this;
         }
     }
     /* END: Perform a re-check / validation in the credit's session. */
     $discount = (double) Mage::app()->getStore()->convertPrice($raw);
     $address->setStoreCreditDiscount($discount);
     $address->setBaseGrandTotal($address->getBaseGrandTotal() - $raw);
     $address->setGrandTotal($address->getGrandTotal() - $discount);
     return $this;
 }
开发者ID:R-MAN-D,项目名称:magento-custom-discount-store-credit-module,代码行数:30,代码来源:Deduction.php

示例4: collect

 public function collect(Mage_Sales_Model_Quote_Address $address)
 {
     if (!$this->_getConfigHelper()->getGeneralConfig('enable', $address->getQuote()->getStoreId())) {
         return $this;
     }
     $customer = $address->getQuote()->getCustomer();
     $baseGrandTotal = $address->getBaseGrandTotal();
     if (!$customer || !$customer->getId() || $baseGrandTotal <= 0) {
         return $this;
     }
     $baseDiscount = 0;
     $luckyCodes = Mage::getModel('luckydraw/code')->getFailedCodes($customer->getId());
     $useCodes = array();
     foreach ($luckyCodes as $code) {
         $codeDiscount = $code->getData('credit_rate');
         $useCodes[] = $code->getId();
         if ($baseGrandTotal - $codeDiscount <= 0) {
             $baseGrandTotal = 0;
             $baseDiscount = $address->getBaseGrandTotal();
             break;
         }
         $baseGrandTotal -= $codeDiscount;
         $baseDiscount += $codeDiscount;
     }
     if ($baseDiscount) {
         Mage::getSingleton('core/session')->setUseLuckydrawCodes($useCodes);
         $discount = Mage::app()->getStore()->convertPrice($baseDiscount);
         $address->setBaseLuckydrawDiscount(-$baseDiscount);
         $address->setLuckydrawDiscount(-$discount);
         $address->setBaseGrandTotal($address->getBaseGrandTotal() - $baseDiscount);
         $address->setGrandTotal($address->getGrandTotal() - $discount);
     }
     return $this;
 }
开发者ID:xiaoguizhidao,项目名称:magento,代码行数:34,代码来源:Luckydraw.php

示例5: collect

 public function collect(Mage_Sales_Model_Quote_Address $address)
 {
     $address->setPaymentCharge(0);
     $address->setBasePaymentCharge(0);
     $items = $address->getAllItems();
     if (!count($items)) {
         return $this;
     }
     $paymentMethod = $address->getQuote()->getPayment()->getMethod();
     if (Mage::getStoreConfig('tax/calculation/price_includes_tax') != 1) {
         $tax = $address->getTaxAmount();
     }
     if ($paymentMethod) {
         $amount1 = Mage::helper('paymentcharge')->getPaymentCharge($paymentMethod, $address->getQuote());
         $amount = Mage::helper('directory')->currencyConvert($amount1, Mage::app()->getWebsite()->getConfig('currency/options/default'), Mage::app()->getStore()->getCurrentCurrencyCode());
         //			if(Mage::getStoreConfig('payment/paypal_payment_solutions/charge_type')!="percentage"){
         $address->setPaymentCharge($amount);
         $address->setBasePaymentCharge($amount1);
         /*			} else {
         					$address->setPaymentCharge($amount);
         				   
         					$subTotal = $address->getBaseSubtotal();	
         					$amount12 = ($subTotal+ $tax) * floatval(Mage::getStoreConfig('payment/paypal_payment_solutions/charge_value')) / 100;
         					$address->setBasePaymentCharge($amount12);
         			}*/
     }
     $address->setGrandTotal($address->getGrandTotal() + $tax + $address->getPaymentCharge());
     $address->setBaseGrandTotal($address->getBaseGrandTotal() + $address->getBasePaymentCharge());
     return $this;
 }
开发者ID:purpleweb,项目名称:flywebdesign_paypalfee,代码行数:30,代码来源:Paymentcharge.php

示例6: collect

 public function collect(Mage_Sales_Model_Quote_Address $address)
 {
     $_helper = Mage::helper('webpos');
     $active = $_helper->enableGiftWrap();
     if (!$active) {
         return;
     }
     $session = Mage::getSingleton('checkout/session');
     $giftwrap = $session->getData('webpos_giftwrap');
     if (!$giftwrap) {
         return $this;
     }
     $items = $address->getAllItems();
     if (!count($items)) {
         return $this;
     }
     $giftwrapType = $_helper->getGiftwrapType();
     $giftwrapAmount = $_helper->getGiftwrapAmount();
     $wrapTotal = 0;
     if ($giftwrapType == 1) {
         foreach ($items as $item) {
             if ($item->getProduct()->isVirtual() || $item->getParentItem()) {
                 continue;
             }
             $wrapTotal += $giftwrapAmount * $item->getQty();
         }
     } else {
         $wrapTotal = $giftwrapAmount;
     }
     $session->setData('webpos_giftwrap_amount', $wrapTotal);
     $address->setWebposGiftwrapAmount($wrapTotal);
     $address->setGrandTotal($address->getGrandTotal() + $address->getWebposGiftwrapAmount());
     $address->setBaseGrandTotal($address->getBaseGrandTotal() + $address->getWebposGiftwrapAmount());
     return $this;
 }
开发者ID:cabrerabywaters,项目名称:magentoSunshine,代码行数:35,代码来源:Giftwrap.php

示例7: collect

 public function collect(Mage_Sales_Model_Quote_Address $address)
 {
     $active = Mage::helper('giftwrap')->enableGiftwrap();
     if (!$active) {
         return;
     }
     if (Mage::app()->getStore()->isAdmin()) {
         return $this;
     }
     $items = $address->getAllItems();
     if (!count($items)) {
         return $this;
     }
     $address_id = $address->getId();
     /*
      * 	update of version 0.2.2
      */
     $giftwrapAmount = Mage::helper('giftwrap')->giftwrapAmount(null, $address_id);
     $address->setGiftwrapAmount($giftwrapAmount);
     $address->setBaseGiftwrapAmount(0);
     //var_dump($address->getData());die();
     // if($giftwrapAmount>0){
     // $taxAmount = 10;
     // $address->setTaxAmount($address->getTaxAmount() + $taxAmount);
     // $address->setBaseTaxAmount($address->getBaseTaxAmount() + $taxAmount);
     // }
     Mage::getModel('core/session')->setData('giftwrap_amount', $giftwrapAmount);
     $address->setGrandTotal($address->getGrandTotal() + $address->getGiftwrapAmount());
     $address->setBaseGrandTotal($address->getBaseGrandTotal() + $address->getGiftwrapAmount());
     //var_dump($address->getData());die();
     return $this;
 }
开发者ID:AleksNesh,项目名称:pandora,代码行数:32,代码来源:Giftwrap.php

示例8: collect

 /**
  * Collect grand total address amount
  *
  * @param   Mage_Sales_Model_Quote_Address $address
  * @return  Mage_Sales_Model_Quote_Address_Total_Grand
  */
 public function collect(Mage_Sales_Model_Quote_Address $address)
 {
     /** @var $helper Openstream_RappenRounding_Helper_Data */
     $helper = Mage::helper('rappenrounding');
     $grandTotal = $address->getGrandTotal();
     $baseGrandTotal = $address->getBaseGrandTotal();
     $totals = array_sum($address->getAllTotalAmounts());
     $baseTotals = array_sum($address->getAllBaseTotalAmounts());
     if ($helper->getScope() == 'totals' || $helper->getScope() == 'all') {
         $address->setGrandTotal($helper->_roundBase5($grandTotal + $totals));
         $address->setBaseGrandTotal($helper->_roundBase5($baseGrandTotal + $baseTotals));
     } else {
         $address->setGrandTotal($grandTotal + $totals);
         $address->setBaseGrandTotal($baseGrandTotal + $baseTotals);
     }
     return $this;
 }
开发者ID:adamskyle,项目名称:Magento5CentRounding,代码行数:23,代码来源:SalesQuoteAddressTotalGrand.php

示例9: collect

 /**
  * Collect reward totals
  *
  * @param Mage_Sales_Model_Quote_Address $address
  * @return Enterprise_Reward_Model_Total_Quote_Reward
  */
 public function collect(Mage_Sales_Model_Quote_Address $address)
 {
     /* @var $quote Mage_Sales_Model_Quote */
     $quote = $address->getQuote();
     if (!Mage::helper('enterprise_reward')->isEnabledOnFront($quote->getStore()->getWebsiteId())) {
         return $this;
     }
     if (!$quote->getRewardPointsTotalReseted() && $address->getBaseGrandTotal() > 0) {
         $quote->setRewardPointsBalance(0)->setRewardCurrencyAmount(0)->setBaseRewardCurrencyAmount(0);
         $address->setRewardPointsBalance(0)->setRewardCurrencyAmount(0)->setBaseRewardCurrencyAmount(0);
         $quote->setRewardPointsTotalReseted(true);
     }
     if ($address->getBaseGrandTotal() >= 0 && $quote->getCustomer()->getId() && $quote->getUseRewardPoints()) {
         /* @var $reward Enterprise_Reward_Model_Reward */
         $reward = $quote->getRewardInstance();
         if (!$reward || !$reward->getId()) {
             $reward = Mage::getModel('enterprise_reward/reward')->setCustomer($quote->getCustomer())->setCustomerId($quote->getCustomer()->getId())->setWebsiteId($quote->getStore()->getWebsiteId())->loadByCustomer();
         }
         $pointsLeft = $reward->getPointsBalance() - $quote->getRewardPointsBalance();
         $rewardCurrencyAmountLeft = $quote->getStore()->convertPrice($reward->getCurrencyAmount()) - $quote->getRewardCurrencyAmount();
         $baseRewardCurrencyAmountLeft = $reward->getCurrencyAmount() - $quote->getBaseRewardCurrencyAmount();
         if ($baseRewardCurrencyAmountLeft >= $address->getBaseGrandTotal()) {
             $pointsBalanceUsed = $reward->getPointsEquivalent($address->getBaseGrandTotal());
             $pointsCurrencyAmountUsed = $address->getGrandTotal();
             $basePointsCurrencyAmountUsed = $address->getBaseGrandTotal();
             $address->setGrandTotal(0);
             $address->setBaseGrandTotal(0);
         } else {
             $pointsBalanceUsed = $reward->getPointsEquivalent($baseRewardCurrencyAmountLeft);
             if ($pointsBalanceUsed > $pointsLeft) {
                 $pointsBalanceUsed = $pointsLeft;
             }
             $pointsCurrencyAmountUsed = $rewardCurrencyAmountLeft;
             $basePointsCurrencyAmountUsed = $baseRewardCurrencyAmountLeft;
             $address->setGrandTotal($address->getGrandTotal() - $pointsCurrencyAmountUsed);
             $address->setBaseGrandTotal($address->getBaseGrandTotal() - $basePointsCurrencyAmountUsed);
         }
         $quote->setRewardPointsBalance($quote->getRewardPointsBalance() + $pointsBalanceUsed);
         $quote->setRewardCurrencyAmount($quote->getRewardCurrencyAmount() + $pointsCurrencyAmountUsed);
         $quote->setBaseRewardCurrencyAmount($quote->getBaseRewardCurrencyAmount() + $basePointsCurrencyAmountUsed);
         $address->setRewardPointsBalance($pointsBalanceUsed);
         $address->setRewardCurrencyAmount($pointsCurrencyAmountUsed);
         $address->setBaseRewardCurrencyAmount($basePointsCurrencyAmountUsed);
     }
     return $this;
 }
开发者ID:hazaeluz,项目名称:magento_connect,代码行数:52,代码来源:Reward.php

示例10: collect

 public function collect(Mage_Sales_Model_Quote_Address $address)
 {
     $address->setCustbalanceAmount(0);
     $address->setBaseCustbalanceAmount(0);
     $address->setGrandTotal($address->getGrandTotal() - $address->getCustbalanceAmount());
     $address->setBaseGrandTotal($address->getBaseGrandTotal() - $address->getBaseCustbalanceAmount());
     return $this;
 }
开发者ID:QiuLihua83,项目名称:magento-enterprise-1.13.1.0,代码行数:8,代码来源:Custbalance.php

示例11: setSubscriptionFee

 protected function setSubscriptionFee(Mage_Sales_Model_Quote_Address $address)
 {
     $fee = "0.01";
     $currentAmount = $address->getSubscriptionFeeAmount();
     $balance = $fee - $currentAmount;
     $address->setSubscriptionFeeAmount($address->getQuote()->getStore()->convertPrice($balance));
     $address->setBaseSubscriptionFeeAmount($balance);
     $address->setGrandTotal($address->getGrandTotal() + $address->getSubscriptionFeeAmount());
     $address->setBaseGrandTotal($address->getBaseGrandTotal() + $address->getBaseSubscriptionFeeAmount());
 }
开发者ID:Adyen,项目名称:adyen-magento-subscription,代码行数:10,代码来源:SubscriptionFee.php

示例12: collect

 /**
  * Collect grand total address amount
  *
  * @param   Mage_Sales_Model_Quote_Address $address
  * @return  Mage_Sales_Model_Quote_Address_Total_Grand
  */
 public function collect(Mage_Sales_Model_Quote_Address $address)
 {
     $grandTotal = $address->getGrandTotal();
     $baseGrandTotal = $address->getBaseGrandTotal();
     $totals = array_sum($address->getAllTotalAmounts());
     $baseTotals = array_sum($address->getAllBaseTotalAmounts());
     $address->setGrandTotal($grandTotal + $totals);
     $address->setBaseGrandTotal($baseGrandTotal + $baseTotals);
     return $this;
 }
开发者ID:ravi2jdesign,项目名称:solvingmagento_1.7.0,代码行数:16,代码来源:Grand.php

示例13: collect

 /**
  * Collect customer balance totals for specified address
  *
  * @param Mage_Sales_Model_Quote_Address $address
  * @return Enterprise_CustomerBalance_Model_Total_Quote_Customerbalance
  */
 public function collect(Mage_Sales_Model_Quote_Address $address)
 {
     if (!Mage::helper('enterprise_customerbalance')->isEnabled()) {
         return $this;
     }
     $quote = $address->getQuote();
     if (!$quote->getCustomerBalanceCollected()) {
         $quote->setBaseCustomerBalAmountUsed(0);
         $quote->setCustomerBalanceAmountUsed(0);
         $quote->setCustomerBalanceCollected(true);
     }
     $baseTotalUsed = $totalUsed = $baseUsed = $used = 0;
     $baseBalance = $balance = 0;
     if ($quote->getCustomer()->getId()) {
         if ($quote->getUseCustomerBalance()) {
             $store = Mage::app()->getStore($quote->getStoreId());
             $baseBalance = Mage::getModel('enterprise_customerbalance/balance')->setCustomer($quote->getCustomer())->setCustomerId($quote->getCustomer()->getId())->setWebsiteId($store->getWebsiteId())->loadByCustomer()->getAmount();
             $balance = $quote->getStore()->convertPrice($baseBalance);
         }
     }
     $baseAmountLeft = $baseBalance - $quote->getBaseCustomerBalAmountUsed();
     $amountLeft = $balance - $quote->getCustomerBalanceAmountUsed();
     if ($baseAmountLeft >= $address->getBaseGrandTotal()) {
         $baseUsed = $address->getBaseGrandTotal();
         $used = $address->getGrandTotal();
         $address->setBaseGrandTotal(0);
         $address->setGrandTotal(0);
     } else {
         $baseUsed = $baseAmountLeft;
         $used = $amountLeft;
         $address->setBaseGrandTotal($address->getBaseGrandTotal() - $baseAmountLeft);
         $address->setGrandTotal($address->getGrandTotal() - $amountLeft);
     }
     $baseTotalUsed = $quote->getBaseCustomerBalAmountUsed() + $baseUsed;
     $totalUsed = $quote->getCustomerBalanceAmountUsed() + $used;
     $quote->setBaseCustomerBalAmountUsed($baseTotalUsed);
     $quote->setCustomerBalanceAmountUsed($totalUsed);
     $address->setBaseCustomerBalanceAmount($baseUsed);
     $address->setCustomerBalanceAmount($used);
     return $this;
 }
开发者ID:hyhoocchan,项目名称:mage-local,代码行数:47,代码来源:Customerbalance.php

示例14: collect

 public function collect(Mage_Sales_Model_Quote_Address $address)
 {
     if ($address->getAddressType() == Mage_Sales_Model_Quote_Address::TYPE_BILLING) {
         return;
     }
     $quote = $address->getQuote();
     $amount = $this->_giftWrapAmount();
     $address->setAmount($amount);
     $address->setGrandTotal($address->getGrandTotal() + $amount);
     $address->setBaseGrandTotal($address->getBaseGrandTotal() + $amount);
     return $this;
 }
开发者ID:hoadaithieu,项目名称:mage-giftwrap,代码行数:12,代码来源:Subtotal.php

示例15: collect

 public function collect(Mage_Sales_Model_Quote_Address $address)
 {
     $quote = $address->getQuote();
     $session = Mage::getSingleton('checkout/session');
     $customer = Mage::getSingleton('customer/session')->getCustomer();
     $params = Mage::app()->getRequest()->getParam('payment');
     if ($params['use_point'] != null || $params['point_amount'] != null) {
         $session->setData('use_point', $params['use_point'])->setData('point_amount', $params['point_amount']);
     }
     if ($session->getData('use_point') && $address->getBaseGrandTotal() && $customer->getId()) {
         $pointAmount = $session->getData('point_amount');
         $rate = Mage::getModel('customerreward/rate')->getPointToMoneyRate($customer->getWebsiteId(), $customer->getGroupId());
         $moneyBase = $pointAmount * $rate;
         $currentMoney = Mage::app()->getStore()->convertPrice($moneyBase);
         $baseSubtotalWithDiscount = $address->getData('base_subtotal') + $address->getData('base_discount_amount');
         $subtotalWithDiscount = $address->getData('subtotal') + $address->getData('discount_amount');
         if ($moneyBase < $baseSubtotalWithDiscount) {
             $address->setBaseGrandTotal($address->getBaseGrandTotal() - $moneyBase);
             $address->setGrandTotal($address->getGrandTotal() - $currentMoney);
             $address->setMoneyBase($moneyBase);
             $address->setCurrentMoney($currentMoney);
             $quote->setMoneyBase($moneyBase);
             $quote->setCurrentMoney($currentMoney);
         } else {
             $pointUsed = ceil($baseSubtotalWithDiscount / $rate);
             $moneyBaseUsed = $pointUsed * $rate;
             $currentMoneyUsed = Mage::app()->getStore()->convertPrice($moneyBaseUsed);
             $session->setData('point_amount', $pointUsed);
             $address->setBaseGrandTotal($address->getBaseGrandTotal() - $baseSubtotalWithDiscount);
             $address->setGrandTotal($address->getGrandTotal() - $subtotalWithDiscount);
             $address->setMoneyBase($moneyBaseUsed);
             $address->setCurrentMoney($currentMoneyUsed);
             $quote->setMoneyBase($moneyBaseUsed);
             $quote->setCurrentMoney($currentMoneyUsed);
         }
     }
     return $this;
 }
开发者ID:AmineCherrai,项目名称:rostanvo,代码行数:38,代码来源:Point.php


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