即使通过管理员禁用,Magento仍会在结账时显示增值税/税金

时间:2011-02-25 13:00:29

标签: magento checkout

我让Magento设置为在结帐时不显示增值税,但它仍在增加总额。它没有将它添加到总数 - 这是正确的。

例如,如果我的物品价格为5英镑 - 含20%的增值税,则为6英镑,这将设置为显示在目录价格中 - 它的确如此。现在结帐时,这个项目将显示为6英镑,然后是1英镑的增值税,然后显示总额,即6英镑?有没有人见过这个?

4 个答案:

答案 0 :(得分:3)

要在文件末尾的/app/code/local/Mage/Sales/Model/Quote/Address/Total/Tax.php中隐藏税务评论:

public function fetch(Mage_Sales_Model_Quote_Address $address)
    {
        $applied = $address->getAppliedTaxes();
        $store = $address->getQuote()->getStore();
        $amount = $address->getTaxAmount();

 /*       if (($amount!=0) || (Mage::helper('tax')->displayZeroTax($store))) {
            $address->addTotal(array(
                'code'=>$this->getCode(),
                'title'=>Mage::helper('sales')->__('Tax'),
                'full_info'=>$applied ? $applied : array(),
                'value'=>$amount
            ));
        }  */
        return $this;
    } 

要在运费中加税,请在文件末尾更改/app/code/local/Mage/Sales/Model/Quote/Address/Total/Subtotal.php

public function fetch(Mage_Sales_Model_Quote_Address $address)
    {
        $amount = $address->getShippingAmount();
        if ($amount!=0 || $address->getShippingDescription()) {
            $address->addTotal(array(
                'code'=>$this->getCode(),
                'title'=>Mage::helper('sales')->__('Shipping & Handling').' ('.$address->getShippingDescription().')',
// OLD          'value'=>$address->getShippingAmount()
                'value'=>number_format($address->getShippingAmount() + $address->getShippingTaxAmount(), 2)
            ));
        }
        return $this;
    } 

要在小计中包含税,请在文件末尾更改/app/code/local/Mage/Sales/Model/Quote/Address/Total/Subtotal.php:

public function fetch(Mage_Sales_Model_Quote_Address $address)
    {
        $address->addTotal(array(
            'code'=>$this->getCode(),
            'title'=>Mage::helper('sales')->__('Subtotal'),
// OLD      'value'=>$address->getSubtotal()
            'value'=>number_format($address->getSubtotal() + $address->getTaxAmount() - $address->getShippingTaxAmount(), 2)
        ));
        return $this;
    } 

答案 1 :(得分:2)

我刚刚在Magento 1.6.2上遇到过同样的问题 - 我认为OP不再需要答案,但它可能会在适当的时候帮助其他人。

假设您只想更改输出,而不是调整任何计算,那么我们可以考虑调整模板文件(.phtml)中的输出。

这具有简单的优点,因为它不会影响可能使用该功能的任何其他内容。

打开模板提示,并访问购物车查看输出,我们看到正在使用的模板是:

前端/碱/默认/模板/税/结帐/ tax.phtml

前端/碱/默认/模板/税/结帐/ subtotal.phtml

作为基础,我们会在进行任何更改之前将这些副本复制到本地(我假设默认/默认) - 所以创建frontend / default / default / template / tax / checkout / tax.phtml&具有相同内容的前端/默认/默认/模板/税/结帐/小计.phtml。

然后在文件中进行以下编辑 - 在两种情况下都会注释掉当前产生输出的行(如果您的设置与我的设置不同,则只跟踪逻辑)。

frontend / default / default / template / tax / checkout / tax.phtml(第46至55行)

    <!--<tr <?php if ($this->helper('tax')->displayFullSummary() && $_value!=0): ?> class="summary-total" onclick="expandDetails(this, '.summary-details-<?php echo $taxIter;?>')"<?php endif; ?>>
<td style="<?php echo $_style . 'display:none;' ?>" class="a-right" colspan="<?php echo $this->getColspan(); ?>">
    <?php if ($this->helper('tax')->displayFullSummary()): ?>
        <div class="summary-collapse"><?php echo $this->getTotal()->getTitle() ?></div>
    <?php else: ?>
        <?php echo $this->getTotal()->getTitle() ?>
    <?php endif;?>
</td>
<td style="<?php echo $_style . 'display:none;' ?>" class="a-right"><?php echo $this->helper('checkout')->formatPrice($_value) ?></td>

- &GT;

frontend / default / default / template / tax / checkout / subtotal.phtml(行数:48到57)

    <?php else : ?>
    <!--<tr>
<td style="<?php echo $this->getStyle() ?>" class="a-right" colspan="<?php echo $this->getColspan(); ?>">
    <?php echo $this->getTotal()->getTitle() ?>
</td>
<td style="<?php echo $this->getStyle() ?>" class="a-right">
    <?php echo $this->helper('checkout')->formatPrice($this->getTotal()->getValue()) ?>
</td>
    </tr>-->
    <?php endif;?>

首先可能存在导致此输出的基础设置或逻辑问题,但是此方法会抑制您不想要的输出。

答案 2 :(得分:0)

在您的配置屏幕截图中,我看到“购物车显示设置”中的价格设置为包含税。如果我理解正确,我认为您应该将其设置为“不含税”(价格和小计)。

答案 3 :(得分:0)

最后,我解决这个问题的唯一方法是取消对magento的税收,并选中表示我们提交的价格含税的方框。不理想。