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


PHP Mage_Sales_Model_Quote_Address::getAllTotalAmounts方法代码示例

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


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

示例1: 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

示例2: 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

示例3: getFeeBaseAmount

 /**
  * Get base amount for calculation of fee (for Magento 1.4.X - 1.6.X)
  * @param Mage_Sales_Model_Quote_Address $shippingAddress
  * @return number
  */
 public function getFeeBaseAmount(Mage_Sales_Model_Quote_Address $shippingAddress)
 {
     return array_sum($shippingAddress->getAllTotalAmounts());
 }
开发者ID:xiaoguizhidao,项目名称:bilderrahmen,代码行数:9,代码来源:Data.php

示例4: calculateDiscount

 public function calculateDiscount(Mage_Sales_Model_Quote_Address $address, $currencyCode)
 {
     $giftCardDiscount = 0;
     $total = 0;
     $totals = $address->getAllTotalAmounts();
     $quote = $address->getQuote();
     if (count($totals) > 0) {
         foreach ($totals as $amount) {
             $total += $amount;
         }
     }
     if ($total > 0) {
         $giftCardDiscount = 0;
         $appliedGiftCardCollection = $this->getGiftCardCollection($quote->getId());
         if (count($appliedGiftCardCollection) > 0) {
             foreach ($appliedGiftCardCollection as $giftCard) {
                 $balance = $giftCard->getBalance($currencyCode);
                 $giftCardDiscount -= $balance;
             }
         }
         //if total less than gift cards balance
         if ($giftCardDiscount < $total * -1) {
             $giftCardDiscount = $total * -1;
         }
     }
     return $giftCardDiscount;
 }
开发者ID:ahsanmage,项目名称:vr,代码行数:27,代码来源:Quote.php


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