How to collect VAT number without apps?

Tourist
4 0 1

I am looking for a simple way to add the ability for the customers to add their VAT number when the make an order. The issue is that in Europe you need to know your customer VAT number if they want an invoice and shopify doesn't have any straighforward way to add it.

The closer I could found was this link here but the links are broken. Could anyone point me to a resource? Probably the best point to collect the VAT number would be at checkout.

1 Like
Shopify Partner
1838 172 549

Hi Joan

Unless you are on Plus+ plan you won't be able to edit the checkout.liquid template.

But that doesn't mean you cannot have customers add their VAT numbers. Checkout (no pun intended) this tutorial on how to add custom cart attributes.

Hope this helps!

I turn coffee in to code - since 1998
2 Likes
Highlighted
Tourist
4 0 1

I'll have a look, I already saw that link but the Caution note at the begin scared me a little.

0 Likes
Shopify Partner
1838 172 549

Well you can give it a try and come back here if you get stuck. I'd try it on a dev / demo store to be safe.

Alternatively you can wait for someone to recommend an app that does just that - I can't really recommend any because I don't have experience using any and because as a developer I like the DIY approach :-D

Either way, feel free to ask if anything in the tutorial isn't clear to you.

I turn coffee in to code - since 1998
0 Likes
Shopify Partner
1650 48 157

the Caution note at the begin scared me a little.

Always backup your themes when making changes.

Duplicate your theme and work on the duplicate to test the change so your live site is unaffected til your ready .

In your cart.liquid(or cart-template.liquid) find the <form> part of the template going all the way to the end </form> tag. On the <form> remove "novalidate" if you require VAT.

Then before then END </form> tag paste:

<p class="cart-attribute__field">
  <label for="vat-number">VAT NUMBER</label>
  <input required class="required" id="vat-number" type="text" name="attributes[VAT NUMBER]" value="{{ cart.attributes["VAT NUMBER"] }}">
</p>

Preview your stores , add item to cart and check the placement of the field. You may need to move that chunk of code somewhere else inside the <form></form> to get in a proper position on the page

Remove "required" from the chunk and keep "novalidate" if you want customers to be able to checkout without entering a VAT

Problem Solved? ✔️Accept the solution so you can help others.
Confused? Busy? ? Get me to solve it paull.newton+shopifyforum@gmail.com.
Buy me a coffee? ☕ paypal.me/paulnewton or donate to eff.org
1 Like
Excursionist
16 0 13

Hi Joan8, 

 

Have you consider to use a compatible software solution to automate the sales tax mess? Quaderno validates VAT numbers, issues tax complying invoices, automatically updates the sales rates when they change and notifies users every time they surpass a sale threshold. Also, with Quaderno tax reports, tax filing is a matter of minutes not hours. 

 

Disclaimer: I work at Quaderno. If you have any questions, please feel free t reach out. I'm happy to help.

1 Like
New Member
1 0 1

I think she want the VAT number on the Customer. Not neccesary on the checkout cart.

Why dont you have a fiend on you Customers for the VAT numbers (or other authority required numbers). This is a big flay in your design.

1 Like