magento – disable “Tax Calculation Based On”

By default magento does Tax calculation based on those 3 default values: Shipping Address, Billing Address, Shipping Origin
This settings can be found in magento admin – System -> Sales / Tax -> Calculation Settings -> Tax Calculation Based On

I needed to disable this behavior, or better said, i needed to set Tax calculation based on the Store location.

In Mage_Tax_Model_Calculation->getRateRequest() i’ve found that, there is in fact 4th option possible marked as ‘default’ (line 315 in Magento CE 1.6.1)

Next in /app/code/core/Mage/Tax/etc/system.xml we can see that above mentioned admin selector has its options set in: adminhtml/system_config_source_tax_basedon

To add the 4th option as visible option in admin, i had extend core file by creating:
/app/code/local/Mage/Adminhtml/Model/System/Config/Source/Tax/Basedon.php

The file content is:

<?php
class Mage_Adminhtml_Model_System_Config_Source_Tax_Basedon
{
public function toOptionArray()
{
return array(
array('value'=>'default', 'label'=>Mage::helper('adminhtml')->__('Store - default')),
array('value'=>'shipping', 'label'=>Mage::helper('adminhtml')->__('Shipping Address')),
array('value'=>'billing', 'label'=>Mage::helper('adminhtml')->__('Billing Address')),
array('value'=>'origin', 'label'=>Mage::helper('adminhtml')->__("Shipping Origin")),
);
}
}

 

Leave a Reply