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


PHP Mage_Tax_Model_Config::setNeedUsePriceExcludeTax方法代码示例

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


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

示例1: collect

 /**
  * Prepare subtotals calculations result before apply tax
  *
  * @param   Mage_Sales_Model_Quote_Address $address
  * @return  Mage_Tax_Model_Sales_Total_Quote_Subtotal
  */
 public function collect(Mage_Sales_Model_Quote_Address $address)
 {
     $this->_areTaxRequestsSimilar = $this->_calculator->compareRequests($this->_getStoreTaxRequest($address), $this->_getAddressTaxRequest($address));
     $address->setSubtotalInclTax(0);
     $address->setBaseSubtotalInclTax(0);
     $this->_subtotalInclTax = 0;
     $this->_baseSubtotalInclTax = 0;
     if (!$address->getTaxSubtotalIsProcessed() && $this->_needSubtractTax($address)) {
         $address->setTotalAmount('subtotal', 0);
         $address->setBaseTotalAmount('subtotal', 0);
         $items = $address->getAllItems();
         foreach ($items as $item) {
             /**
              * Child item's tax we calculate for parent - that why we skip them
              */
             if ($item->getParentItemId()) {
                 continue;
             }
             if ($item->getHasChildren() && $item->isChildrenCalculated()) {
                 foreach ($item->getChildren() as $child) {
                     $this->_resetItemPriceInclTax($child);
                     $this->_recollectItem($address, $child);
                 }
                 $this->_recalculateParent($item);
             } else {
                 $this->_resetItemPriceInclTax($item);
                 $this->_recollectItem($address, $item);
             }
             $this->_addSubtotalAmount($address, $item);
         }
         if ($this->_areTaxRequestsSimilar) {
             $address->setSubtotalInclTax($this->_subtotalInclTax);
             $address->setBaseSubtotalInclTax($this->_baseSubtotalInclTax);
         }
         $this->_config->setNeedUsePriceExcludeTax(true);
     } elseif (!$address->getTaxSubtotalIsProcessed() && !$this->_needSubtractTax($address)) {
         foreach ($address->getAllItems() as $item) {
             $this->_resetItemPriceInclTax($item);
         }
     }
     if (!$address->getTaxSubtotalIsProcessed() && $this->_needSubtractShippingTax($address)) {
         $this->_processShippingAmount($address);
         $this->_config->setNeedUseShippingExcludeTax(true);
     }
     $address->setTaxSubtotalIsProcessed(true);
     return $this;
 }
开发者ID:joebushi,项目名称:magento-mirror,代码行数:53,代码来源:Subtotal.php


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