Configuring taxes in Magento stores works well in case they are targeting B2C markets in Europe. For B2B stores and especially stores targeting both B2B and B2C customers it’s a different matter – in one of our latest projects we stumbled upon a number of limitations, which we were able to overcome with two new modules. We have published both modules with an open source license, so you are now able to download them free of charge. In this blog post, we show you why they are needed and how they work.
Let’s assume that the country of origin is Germany. You can easily switch to any other EU country (e.g. UK or France).
The Basis: FireGento_MageSetup
MageSetup comes with many basics to prepare Magento for the European market, a well prepared tax configuration is one of them. We recommend using MageSetup for every EU store.
Preparation: Adjusted Tax Configuration
Since entering tax rules is a complex task, prone to errors, we generated one handy SQL file containing the complete tax configuration, ready to download. Caution: Please do a database backup before using the tax configuration. If anything should go wrong, the backup helps you to undo changes made by the SQL file.
Problem: Validation of VAT ID and Assignment of Customer Tax Classes
Since version 1.7, Magento has a feature to automatically assign customers to a certain customer group upon registration. This feature has been extensively described by Matthias Zeis (sorry, German only). Unfortunately, the feature leads to a big number of customer groups, while store owners often prefer to use customer groups for their original purpose, e.g. for offering customer group specific prices. Another problem is that VAT IDs are country specific, therefore, a change of shipping country requires a new VAT ID validation and an assignment to a different customer group. This, however, does not happen in Magento.
Solution: Separation of Tax Class and Customer Group
In order to solve this problem, we decided not to make a change of customer group depending on VAT ID. Instead, the customer tax class is only set when it is needed. So we added an additional field in the customer group settings: a tax class which is to be used in case of a valid VAT ID.
The corresponding module is available to download from GitHub.
Problem: Different Tax Display of B2B and B2C
Another hurdle is the different tax display for private customers and corporate customers. The problem can be quickly explained: B2C customers shall see gross prices, whereas B2B customers are interested in net costs. Magento’s standard configuration only offers one setting, which is globally used for all customer groups.
Solution: Separated Tax Configuration for Customer Groups
To overcome this issue, we have created an alternative tax configuration, which can be found directly below the usual configuration:
Here, you find settings relevant for the display of taxes as duplicates. These settings are applied to the customer groups defined above:
The configuration settings are loaded dynamically, depending on which customer group is selected. The responsible module is available to download from our GitHub repository aswell.
The tax configuration available in Magento is strong and offers a solution for most cases. The complex tax regulations of the European Market – especially the B2B market – require more flexibility. With two small modules you can easily integrate all the functionalities you need.
Author: Andreas von Studnitz
Andreas von Studnitz is a Magento developer and one of the Managing Directors at integer_net. His main areas of interest are backend development, Magento consulting and giving developer trainings. He is a Magento 2 Certified Professional Developer Plus and holds several other Magento certifications for both Magento 1 and Magento 2. Andreas was selected as a Magento Master in 2019 and 2020.