Tax Set

Magento Tax Setup for Switzerland and Liechtenstein

During the last two days I spent quite some time configuring a Swiss B2C Magento v1.8.1.0 store with 8% VAT. For clients from Switzerland and Liechtenstein, prices should display including tax (gross = Brutto) on all catalog pages. Both in the shopping cart and on the checkout confirmation page, VAT should be correctly shown in the order totals as indicated in the screenshot below.

Shoping Cart with VAT


Sales / Tax Settings

The first set of the configurations that needs to be taken care of is under Sales/Tax in your Magento backend. You might want to delete the US tax rates, classes and rules that come with the default installation before you create new ones.

Manage Tax Rates

First you will have to create two different tax rates, one for Switzerland and one for Liechtenstein.

Tax Rates Switzerland/Liechtenstein

Product Tax Class

After that, create a tax class called 8% MwSt. or 8% TVA if you’re from the French part of Switzerland.

Manage Tax Rules

In the last step create a tax rule where you select your just created product tax class and both new tax rates.

Magento Tax Rule for Switzerland


System / Configuration / Sales / Tax Settings

The second set of configurations is under System / Configuration / Sales / Tax. Although Magento lets you decide whether you want catalog prices to be entered in the backend including or excluding tax, for a B2C store excluding tax is the only viable option, because if you set this to including tax and enter all product prices as gross prices you will end up with VAT added on top of product prices which does not make sense.

So here’s how the tax setting look in my B2C store.

System Configuration Tax Settings Part 1

System Configuration Tax Settings Part 2


Swedish Rounding

That would now all be very straight forward if it wasn’t for something called Swedish rounding.

The term Swedish rounding is used mostly in Australia, where such a method has been practiced since the 1990s. In Switzerland it is called 5 cent rounding (5-Rappen-Rundung). It means rounding with 0.05 intervals.

If a products costs e.g. 49.00 CHF (Swiss Francs) including 8% tax, it is entered in the Magneto backend excluding tax (net) for 45.3704 CHF. It is required that you use at least 4 decimal places (Nachkommastellen), so that the 5 cent rounding is working OK. If you add 8% to the net price, it will amount to 49.000032, but as only 2 decimal places are shown, it will be 49.00.

After saving a product with 4 decimal places in Magento, the backend will only display 2 decimal places, but in the database it will store all 4. The problem here is that if you save this product for the second time, it will then only save 2 decimal places in the database which will then result in  incorrect rounding, i.e. if you add 8% tax to 45.37 you will end up with a gross price of 48.99.

Although I imported all prices with 4 decimal places into my client’s B2C store, I have some rare instances where the Swedish rounding is not working as expected. I checked those products in the database and can confirm that they have 4 decimal places, but still end up with prices not rounded to 0.05 intervals.

I will take another approach next week to understand why this is happening and will then try to share more insights in this article. 

If you want to learn more about this complex subject matter, the Magento Knowledge Base holds very detailed information about Magento tax settings. Once I get this 100% right, I will try to get this information directly into the knowledge base.

The following two tabs change content below.

Nick Weisser

Inhaber, Entwickler und Chief Happiness Officer bei Openstream
DevOps ninja, developer and chief happiness officer @openstream, Swiss Magento usergroup lead, WordPress and WooCommerce polyglot for de_CH and blogger. Ist bei Openstream für Projektleitung und Qualitätskontrolle zuständig, wobei er sehr gerne Tools wie JIRA und Git verwendet, um Aufgaben und Code-Änderungen zu jonglieren. Wenn er sich nicht mit Magento oder WordPress beschäftigt, ist er gerne auf dem Bodensee stehsegeln oder am Feldberg und in den Alpen skifahren.

Neueste Artikel von Nick Weisser (alle ansehen)

Flattr this!

4 Antworten
  1. Chuck Choukalos
    Chuck Choukalos says:

    The Magento Tax engine ( introduced in CE 1.8.0 ) internally has something that we consider the golden price.  That’s the price that we make sure always ties off to subtotals/totals/etc.  The non-golden price is effectively derived from the golden price.  We tie the golden price to how the catalog is loaded;

    Because of this, for country’s where prices are displayed including tax we recommend that you set catalog pieces are loaded to ‘including tax’.  It’s a little odd – effectively Magento will load the price (including tax) from the database; then calculate the tax based upon the store’s location ( 8% tax rate ) to derive the tax amount and untaxed price.  The calculations will make sure that prices/subtotals/totals all tie off.

    If you have any questions please feel free to contact me.


Trackbacks & Pingbacks

  1. […] einiger Zeit habe ich den Artikel Magento Tax Setup for Switzerland and Liechtenstein geschrieben auf welchen sich Chuck Choukalos (Senior Product Manager bei Magento) und Sylvain Rayé […]

  2. […] Noch einmal Nick: er schrieb über die Steuerkonfiguration für die Schweiz und Liechtenstein. […]

Hinterlassen Sie einen Kommentar

Wollen Sie an der Diskussion teilnehmen?
Feel free to contribute!

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert.