Price VAT incl. and excl. on product detail page DAWM Theme

Hi,

I am having a hard time getting the prices incl. and excl. VAT to show on the product page of our store. It is the DAWM theme with url: https://procardio.shop/

I tried to follow up this tutorial: https://community.shopify.com/c/shopify-design/product-pages-show-vat-prices-on-your-product-pages/td-p/614976. No luck at all. Can anyone please help me out with this? I will most thankfull!

Hi @Teddy9

Please follow these steps:

  • Step 1: At Shopify admin, Select Online Store β†’ Themes β†’ Edit Code

  • Step 2: Find and open the file price.liquid:

![view (24).png|365x519](upload://h6rcK5Ehkgb6VRnTZElNU2xwtfK.png)
  • Step 3: Add this line at the top of the price.liquid file, like this:

{% assign tax_rate = 20 %}
  • You can change the tax rate based on your tax settings in the store. Here, we set up a tax rate of 20%.

  • Step 4: Press Ctrl + F, and paste this line in the search bar β†’ Click next:


  • Step 5: Change the code inside the tag you just found with the following code:
{% if template == "product" %}
  {{ product.price | times: tax_rate | divided_by: 100 | plus: price | money_with_currency }} incl. {{ tax_rate }}% VAT 

  {{ money_price }} excl. {{ tax_rate }}% VAT
{% else %}
  {{ money_price }}
{% endif %}

  • Step 6: Press Ctrl + F, and paste this line in the search bar β†’ Click next:

  • Step 7: Change the code inside the tag you just found with the following code:
{% if template == "product" %}
  {{ product.price | times: tax_rate | divided_by: 100 | plus: price | money_with_currency }} incl. {{ tax_rate }}% VAT 

  {{ money_price }} excl. {{ tax_rate }}% VAT 
{% else %}
  {{ money_price }}
{% endif %}

  • Here is the result:

I hope that it will work for you.

1 Like

Absolutely wonderful! Thanks for this!

1 Like

Hello @Teddy9

I can see that you found a solution which is great!

I would just like to mention our app that we developed for cases like this. It’s called T-Selector and it lets your customers to select if they like to see the price excluding or including VAT.

One big benefit of doing it this way is that you reduce the risk of being banned from Google merchant center and Google Shopping which will happen if they detect more than one price (two if you have a sale).

You can find out more about T-Selector in Shopify app store - https://apps.shopify.com/tax-selector

Best regards,

Adam

www.zoeproduction.com

Thank you so much for this answer.

One question I do have: what if I want to display different tax-%-amounts depending on which country the visitor is visiting the website from?

So that the visitor from Austria (who lands on our Austrian subfolder domain we have set in shopify market) sees 21%
the visitor from Germany (who lands on our German subfolder domain we have set in shopify market) sees 19%
and the visitor from Switzerland (who lands on our Swiss subfolder domain we have set in shopify market) 0% for example.

Do I manually have to put every country + the according %-amount in the code or is possible that some code snippet pulls the correct tax-% from Shopify automatically?

Thank you so much in advance!

Best regards,

Peter

Hi Peter,

If you would like to make this ease for you, you can test our app https://apps.shopify.com/tax-selector which does this for you via geo location. If a customer is in Germany they will see the 19% VAT-rate for example.

All you need to do is set these in the app, like this - https://zoeproduction.com/blogs/guide/how-to-set-vat-rates

One more benefit of using our app is that you only show one price at the time which ensures Google won’t ban you because of double pricing. The customer can select if they want to see the price inclusive or exclusive VAT on your site.

Let me know if you have any further questions.

Kind regards

Adam

Works really good, thank you very much!

1 question: on the page of product its selve, in & excl VAT is correct. But not visible in shop when you see multiple products?

Hi there,

I have tried to change the code as above but not been successful. Does the method above still work today? Do you provide a sevice to help me with the code?

M<any thnaks,

Best regards,

David