Product pages - Show VAT prices on your product pages

Highlighted
Community Manager
Community Manager
479 27 591

If your government requires you to show prices with taxes included, but you want your international customers to pay less than the VAT-included price, you will need to show two prices in your shop. One price will be with taxes included for your local customers, and one price will be without taxes for your international customers.


Tip
: The solution presented here won't work in the following themes: Venture and Boundless.


Note
: This solution will only work if your products have only one variant, and the price on the product page is not updated via JavaScript (usually found in a selectCallback function).

 

Set your tax rates

 

 

Shopify will automatically set your tax rates for you, but you might want to confirm that those rates are correct. To do so:

 

  1. From your Shopify admin, go to Settings > Taxes.
  2. Look at the tax rates. Click on the country's name to change a country's tax rate.
  3. In the Tax Calculations section, make sure that the Show all prices with tax included checkbox is unchecked.

    vat-01.png

  4. Save any changes.

 

Edit your theme

 

 

We're going to find the locations where the theme calls on product price. This will generally appear as:

 

{{ product.price | money }}

 

We will want to add in a variable here that will multiply the price by your tax rate:

 

{{ product.price | times:1.XX | money }}

 

Where XX = your tax rate. So if your tax rate is 10%, it should be times:1.1. If it's 5%, it should be times:1.05. In Canada, the federal tax rate is 5%, so we'll use times:1.05.

 

This tutorial will use the Minimal theme as an example — every theme is built differently, so the areas where you have to modify your theme will differ if you're using another theme.

 

  1. From your Shopify admin, go to Online Store > Themes.
  2. Find the theme you want to edit, and then click Actions > Edit code.
  3. There are four main places where we'll want to change the code to affect how prices are displayed:

 

Home Page and Collection listings

 

 

The Minimal theme changes this in the exact same spot.

  1. From your Shopify admin, go to Online Store > Themes.
  2. Find the theme you want to edit, and then click Actions > Edit code.
  3. Click the Snippets folder to expand and view the folder's contents.
  4. Click the product-grid-item.liquid snippet to open it in the online code editor.
  5. Locate the following: 

    {{ product.price | money }}

     

  6. Change it to:

    {{ product.price | times:1.05 | money }} Int price: {{ product.price | money }}

    So that it looks like this:

    vat-02.jpg

  7. Save your changes.

 

Product page

 

 

  1. Under the Templates folder, locate and click on product.liquid to open it in the online code editor.
  2. In the online code editor, look for:

    {{ product.price | money }}

     

  3. Change that to:

    {{ product.price | times:1.05 | money }}

     

  4. Under <div class="purchase">, add:

    <h3>Int price: {{ product.price | money }}</h3>
    

    before the closing </div> tag.

    It should look like this:

    vat-03.jpg

  5. Save your changes.

 

Cart

 

 

Showing the international price for each line item in the table will most likely just make the page very cluttered and confusing. So we'll just add a note at the top of the page that lets international customers know that they will receive 5% off of the listed price. We will also add an international price at the end of the cart.

 

  1. Under the Templates folder, locate and click on cart.liquid to open it in the online code editor.
  2. Under the opening <div>, add:

    <h3 style="text-align:center; color:red">All international orders receive 5% off!</h3>

    So that it appears like this:

    vat-04.jpg

  3. We'll now change the line item prices in the table so that they are also marked up:

    {{ item.line_price | money }}


    Changes to:

    {{ item.line_price | times:1.05 | money }}


    So that it appears as such:

    vat-05.jpg

  4. We'll now add the international final price below the regular final price. Change:

    {{ cart.total_price | money }}

    to

    {{ cart.total_price | times:1.05 | money }} <br /> Int price: {{ cart.total_price | money }}
  5. Save your changes.

Your shop will now show both your prices including VAT as well as your international price without. Check out this test shop to see how it works.

TyW | Community Manager @ Shopify
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Click Accept as Solution 

1 Like
Highlighted
Excursionist
18 0 4

Hi TyW, thanks for this information. On our store we want to display prices both with and without tax, but we have a few products where no tax is charged - these are in a collection and we use the Tax Override function. Is there a way to implement your solution but with a variable tax rate, rather than entering a fixed rate such as 1.2 as shown on your example? Thank you.

2 Likes
Highlighted
New Member
1 0 5

As per my point of view: the logic implemented by Shopify is not correct.

 

When prices are shown tax inclusive in shop pages, prices should show tax exclusive in checkout page if the country is tax exempt. otherwise the customer's country end up paying more.

 

Furthermore in checkout page taxes and tax rate should always show in any case.

 

That's how Woocommerce has implemented their logic.

5 Likes
Highlighted
Tourist
7 0 3

Will this coding change the pricing in invoices i am sending out too?

My online store is synced with Vend and the prices it pulls in are tax inclusive. I think I need to use this code to show the without tax prices on the product/collection pages but ultimately to send correct VAT invoices to EU Business Customers 

0 Likes
Highlighted
New Member
2 0 4

Hi TyW - great article, thanks, but do you know of a solution for this issue where products DO have multiple variants?

2 Likes
Highlighted
New Member
1 0 1

Hi TyW,

I've just installed a theme called Wokiee on my Shopify test site, I wonder if you can advise how I would make the changes on that. I had a look myself, but the lines must be some other place. 

 

I was using a Magento1 site and thought I may be able to Shopify, because I cant afford Magento2. I have a B2B business.

Thank you.

1 Like
Highlighted
New Member
1 0 0

Hey there! 

I am on that issue.

I have modified the code and it works on main product, but not with variants.

Have you found the way?

 

Kind regards

0 Likes
Highlighted
New Member
1 0 0

Are you able to only display the non-VAT price in the basket for international customers? So only add this code to the cart? I would prefer not to show the International price on the product page and collection listing.

0 Likes
Highlighted
New Member
3 0 0

i can code for multiple variants. ishopifyexpert@gmail.com :)
Thanks

0 Likes
Highlighted
New Member
1 0 0

You are correct.

It should be the opposite. Not showing the excluding taxes price, and adding taxes at checkout.

0 Likes