Magento still displays VAT / TAX on checkout even though disabled via admin
I have Magento set up to not display VAT on checkout开发者_如何学JAVA, but it is still adding at the total. It doesn't add it up to the total - which IS correct.
For example if I have an item that costs £5 - with 20% VAT it is £6 and this is set to show in the catalogue prices - which it does. Now on checkout this item would display as £6, then £1 VAT and then shows the total, which is £6..? Has anyone else seen this?
To hide the tax comment out in /app/code/local/Mage/Sales/Model/Quote/Address/Total/Tax.php at the end of the file:
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;
}
To include the tax in the shipping costs, change in /app/code/local/Mage/Sales/Model/Quote/Address/Total/Subtotal.php at the end of the file
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;
}
To include the tax in the subtotal, change in /app/code/local/Mage/Sales/Model/Quote/Address/Total/Subtotal.php at the end of the file:
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;
}
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.
In your configuration screenshot I have seen that the prices in "shopping cart display settings" are set to be displayed including tax. If I understand you correctly, I think you should set this to "Excluding Tax" (for prices and subtotal).
In the end the only way i solved this was by removing the tax out of magento and check the box that says the prices that we submit contain tax. Not ideal.
精彩评论