Collect your customers VAT number

Explains how you may capture your customers VAT to display this information on your templates

Blanca Gongora avatar
Written by Blanca Gongora
Updated over a week ago

Collecting customers' VAT/TAX numbers in Shopify is important for Legal requirements. As a merchant, you can collect the customers' VAT IDs through either the customer registration or cart pages. Once an order is placed, these details are saved, and our Order Printer Pro templates can display them.

Capture the Customer VAT ID on the customer Registration page (as customer note)

NOTE: The instructions below are helpful if you're using the Classic customer account, which is the one that actually displays a registration page.

You can add a VAT number field to the customer registration form so your customers can input their VAT registration numbers during the setup of their customer accounts in your Shopify store.

You may get the VAT number field to the customer registration page by following these steps:

On Shopify's old themes:

  1. In your Shopify admin, go to Online Store > Themes.

  2. Click the button, then click Edit code.

  3. Search and select customers/register.liquid in the left sidebar.

  4. Insert the following code snippet inside the < form > and save.

<!-- Shopify Customer Registration to collect customer VAT --> 
<label for="vat_number"</label>
<input type="text" name="customer[note][VAT ID]" id="vat_number" class="input-full" placeholder="VAT Number">

Adding the snippet just after the last name field section gives us this result:

On Shopify's newest themes:

  1. In your Shopify admin, go to Online Store > Themes.

  2. Click the button, then click Edit code.

  3. Search and select main-register.liquid in the left sidebar.

  4. Insert the following code snippet after one of the input field sections and save.

<!-- Shopify Customer Registration to collect customer VAT -->           
<div class="field">
<input
type="text"
name="customer[note][VAT ID]"
id="vat_number"
placeholder="VAT Number"
>
<label for="vat_number"> VAT Number
</label>
</div>

We suggest adding the snippet just after the last name field, and this is the result:

Your customers will be able to input the VAT registration number, and it will be stored as part of the customer notes. Order Printer Pro can then display the customer notes in your templates, as explained in this guide.

💡For more details on adding fields to the customer registration form, please get in touch with Shopify Support and review their official documentation here.

Capture the Customer VAT ID on the cart page (as cart attributes)

You may set a VAT ID field in the cart page so that your customers can enter their VAT registration numbers just before checkout.

To achieve this, you need to add the following code snippet to the cart file in your theme.

To add the Tax ID field to the cart page:

  1. In your Shopify admin, go to Online Store > Themes.

  2. Find the theme you want to edit, and then click Actions > Edit code.

  3. In the Sections directory, click cart-template.liquid.
    If your theme doesn't have a cart-template.liquid, then try main-cart-footer.liquid. If your theme doesn't have it either, then in the Templates directory, find cart.liquid.

  4. Find the closing </form> tag in the code.

  5. On a new line right above the closing </form> tag, paste the code. However, If your theme has main-cart-footer.liquid, then add the snippet on the cart footer section.

<!-- Shopify Shopping Cart attributes to collect customer VAT --> 
<p class="cart-attribute__field">
<label for="vat-id">VAT ID</label>
<input id="vat-id" type="text" name="attributes[VAT ID]" value="{{ cart.attributes["VAT ID"] }}">
</p>

That's it! You'll get a result similar to this:

Your customers will now be able to input the VAT registration number, and it will be stored as cart attributes. Order Printer Pro will then display these attributes in your templates, as explained in this guide.

💡For more details on adding fields to the cart page, please get in touch with Shopify Support and review their official documentation here.

Have any questions or need some help? No worries, reach out to our friendly support team!

Did this answer your question?