Skip to main content

Collect your customer's VAT number

Explains how you may capture your customer's VAT to display this information on your templates

Lauro Oller avatar
Written by Lauro Oller
Updated this week

Collecting customers' VAT/TAX numbers in Shopify is necessary for Legal requirements. As a merchant, you can collect customers' VAT IDs through either the customer registration page or the cart page. 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 a 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, allowing your customers to input their VAT registration numbers during account setup in your Shopify store.

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

On Shopify's old theme:

  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 theme

  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 enter their VAT registration number, and it will be stored in the customer notes. Order Printer Pro can then display the customer notes in your templates.

💡 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 can set a VAT ID field on the cart page so that your customers can enter their VAT registration numbers before checkout.

To achieve this, 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.

💡 For more details on adding fields to the cart page, contact Shopify Support and review their official documentation here.

Do you have any questions or need help? No worries, reach out to our friendly support team!

Did this answer your question?