How can I change tax rates, when changing the shipping destination while checkout?
I didn't find settings for that in the backend (correct my if I'm wrong) so I think I have to solve that with an own module.
Where do I start with that project?
Example-Goal:
Any ideas, which classes and methods have to be changed for that?
Thanks in advance.
I solved my task.
I override the Mage_Tax_Model_Calculation method getRateRequest. Here I can add my own logic before the switch statement which used $basedOn to assign the $address.
//override basedOn
$basedOn = 'billing';
if ($shippingAddress != null && $billingAddress != null) {
if ($shippingAddress->getData('country_id') != $billingAddress->getData('country_id') && $shippingAddress->getData('country_id') == 'DE') {
$basedOn = 'shipping';
}
}
// needed to still work if one of both addresses is null
if ($shippingAddress == null || $billingAddress == null) {
$basedOn = 'default';
}
else {
$ship = $shippingAddress->getData('country_id');
$bill = $billingAddress->getData('country_id');
if(empty($ship) || empty($bill)) {
$basedOn = 'default';
}
}