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


PHP Mage_Tax_Model_Config::applyTaxAfterDiscount方法代码示例

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


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

示例1: applyTaxAfterDiscount

 /**
  * Check what taxes should be applied after discount
  *
  * @param Mage_Core_Model_Store|int $store
  * @return  bool
  */
 public function applyTaxAfterDiscount($store = null)
 {
     if ($this->_getDataHelper()->isServiceEnabled($store)) {
         if (!$this->_getTaxDataHelper()->priceIncludesTax($store)) {
             return true;
         }
     }
     return parent::applyTaxAfterDiscount($store);
 }
开发者ID:onepica,项目名称:avatax,代码行数:15,代码来源:Config.php

示例2: _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);
                 $shippingBaseTax = $this->_calculator->calcTaxAmount($baseCalcAmount, $rate, true);
                 $shippingAmount -= $shippingTax;
                 $baseShippingAmount -= $shippingBaseTax;
             } else {
                 $shippingTax = $this->_calculator->calcTaxAmount($calcAmount, $rate);
                 $shippingBaseTax = $this->_calculator->calcTaxAmount($baseCalcAmount, $rate);
             }
             $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:joebushi,项目名称:magento-mirror,代码行数:59,代码来源:Tax.php

示例3: applyTaxAfterDiscount

 /**
  * Check what taxes should be applied after discount
  *
  * @param   mixed $store
  * @return  bool
  */
 public function applyTaxAfterDiscount($store = null)
 {
     return $this->_config->applyTaxAfterDiscount($store);
 }
开发者ID:xiaoguizhidao,项目名称:blingjewelry-prod,代码行数:10,代码来源:Data.php


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