2

我已将 Magento 设置为在结帐时不显示增值税,但它仍在总计中添加。它不会把它加到总数中——这是正确的。

例如,如果我有一件商品价格为 5 英镑 - 含 20% 增值税,价格为 6 英镑,并且设置为在目录价格中显示 - 它确实如此。现在结帐时,这个项目会显示为 6 英镑,然后是 1 英镑的增值税,然后显示总额,即 6 英镑..?有没有其他人看过这个?

4

4 回答 4

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;
    } 
于 2011-02-25T14:37:29.517 回答
2

I have just run across the same issue on Magento 1.6.2 - I apreciate the OP no longer wants an answer, however it may assist someone else in due course.

Assuming you just want to change output, and not adjust any calculations, then we can look at adjusting the output in template files (.phtml).

This has the simple advantage in that it does not effect anything else that may use the function.

With template hints on, and visiting the cart to see the output, we see that the template in use is:

frontend/base/default/template/tax/checkout/tax.phtml

and

frontend/base/default/template/tax/checkout/subtotal.phtml

As its in base, we will make a copy of these into local (I am assuming default/default) before we make any changes - So create frontend/default/default/template/tax/checkout/tax.phtml & frontend/default/default/template/tax/checkout/subtotal.phtml with the same content.

Then make the following edits in the files - in both cases commenting out the row currently producing output (just trace the logic if your settings are not he same as mine).

frontend/default/default/template/tax/checkout/tax.phtml (lines 46 to 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>

-->

frontend/default/default/template/tax/checkout/subtotal.phtml (lines:48 to 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;?>

There may be an underlying set up or logic issue to cause this output in the first place, however this method will supress the output you dont want.

于 2012-04-23T04:10:05.227 回答
0

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

于 2011-02-26T15:56:24.737 回答
0

最后,我解决此问题的唯一方法是从 magento 中删除税款,并选中显示我们提交的价格包含税款的框。不理想。

于 2011-08-05T09:36:59.467 回答