Ok, long question coming up. Please have patience. TLDR: How can i deduct correct tax within eu given tax rate depending on a combination of store front and shipping address but still sell with no tax outside of EU.

So I have a Swedish store front and an UK store front. If a sweden resident shops in the Swedish store I want product X to cost 100 kr including tax with a tax rate of 25%. If a UK resident shops in the UK store I want the price to be £10 including tax with a tax rate of 20%. If someone from outside the EU shops in either store no tax should be taken so the price should be 80 kr in the swedish store and £8.33 in the UK store. Now for the tricky part: if someone from outside UK but within EU shops in the UK store I want the total price to still be £10 but with a tax rate of 25%. I also always want the price to be displayed as £10 in the store. The only time it changes from £10 is if a non-eu resident proceeds to the checkout.

The UK store has default tax destination and origin country set to UK. The Swedish store has default tax destination and origin country set to Sweden.

A tax rate for the UK is setup at 20% and one for Sweden at 25%. The product shares the same tax class. A tax rule is set up for that tax class and the customer class "End customer" that includes all tax paying regions (all EU countries including Sweden and the UK.

Catalog prices are set to be including tax.

The result is a correct price for a swedish resident at the swedish store (80 kr + 20 kr tax = 100 kr total), correct for a UK resident at the UK store (£8.33 + £1.67 = £10 total) and correct for a non-eu resident in the EU store (£8.33 total).

The problem comes if now a German or other EU resident (outside of UK) shops in the UK store. The price is now (£8.34 + £2.08 = £10.42 total). The error being it calculates the price excluding tax using the UK tax rate instead of the German. Plus there is some rounding error to show a different price ex VAT now then when the country was UK but let's ignore that... :)

With Magento 1.9 I can though set Magento to cross border trade (CBT). This will then give me correct behaviour for all EU countries but leave the non-EU customer to pay full tax (although the tax won't be specified separately in the summary).

So I see two solutions: 1. Have CBT enabled but with an exception for non-EU customers where they get the final price excluding VAT. 2. Not enable CBT and have magento calculate the price excluding tax using the shipping tax rate but only if the tax rate is more than 0%, else it should use the tax rate of the origin country.

Any other ideas out there? If not, any suggestions to where I would hack the code to enable 1 or 2 (1 seems like the easiest path)?

3 Answers 3


After trying a lot of different hacks of the core code I had a big cup of coffee and came to a much simpler solution without any hacking at all!

I set UK to UK VAT (20%) and all EU countries to Swedish VAT (25%). All other countries are then by default 0% VAT.

Now for the magic. I enabled Cross Border Trade and created a discount code (shopping cart price rule) which applies a discount of 0,166667 (20% VAT) on all orders where shipping country is not an EU country. SUCCESS!!

  • The only problem with this solution is that I need to add a condition for every non-eu country. So a couple of hundred lines of "Shipping country is ...". You would think it would work to just do "Shipping country is not ..." for the EU countries but no, this then applies the discount to all new users who have not selected a country which means ugliness until they do.
    – Klistrian
    May 27, 2015 at 13:00
  • Solved the issue av setting up discount code for all non-EU countries. See magento.stackexchange.com/questions/112868/…
    – Klistrian
    Aug 24, 2016 at 13:26

Have you set the correct shipping origin under admin -> system -> configuration -> sales -> shipping settings, it is important for VAT calculation.

Also I would not enable CBT unless you want to sell your products with same price across globe.

Here is the correct VAT settings -:

enter image description here

  • Yeah, I have that all set "correctly" as you can read in my question. As for CBT I want all countries where we charge tax to have the same product prices (but charge a tax % depending on country). But for countries where we don't charge tax I want to charge the customer our default price but subtract our default tax.
    – Klistrian
    Oct 24, 2014 at 9:17

I have had a similar headache, and for me it all sorted out nicely once I set the backend prices to be excluding VAT.

Thereby you will have a good base price and then the different VAT rates applied to two of your store views.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.