How to enable both prices with tax and without tax
Monday, 02 September 2019
In some cases, due to commercial needs, you may need to view the prices of the products in your catalog differently depending on customer type.
In this example, we will ensure that for guests the price is displayed including taxes, while for customers logged in the price is displayed excluding taxes.
To do this, edit functions.php file that you find in your site’s FTP space in:
and insert this code:
You can also extend this behaviour, for example, displaying prices with taxes not only if customer is logged in but also if he belong a WooCommerce B2B group:
It is advisable not to edit the theme files directly, but to use a child theme.
For more information on child themes, please read: WordPress Official guide on Child Themes