• Skip to primary navigation
  • Skip to main content
  • Skip to footer
Essential Premium WooCommerce Plugins - WP Desk
  • Plugins
  • Support
  • Blog
  • My Account
  • 0

Stay updated on our how-to articles

WP Desk news, WooCommerce tips, promo codes - right to your inbox.

By entering your e-mail, you agree to our Terms & Conditions and Privacy Policy.

Bartosz Gajewski

EU VAT number validation in WooCommerce

Updated: January 21, 2022 / Plugin Tutorials

Adding EU VAT number field on the checkout page can be an important thing to do in WooCommerce store, especially when you sell to the business owners. In this article, I’ll show you how to display that field and how to add EU VAT number validation.

If you are selling in the European Union, probably you know that it demands to respect some legal aspects. One of the most important things is to support the VAT identification number (known as VAT Number or EU VAT). Without it, you can’t issue a valid invoice. WooCommerce doesn’t cover it, so you have to use some plugins.

Add EU VAT field with Flexible Checkout Fields

In this example, I’ll use the free version of Flexible Checkout Fields. It’s the easiest way to add the EU VAT field in WooCommerce. Flexible Checkout Fields is very well rated plugin with over 70,000 store using it daily.

Add EU VAT number field in WooCommerce Checkout

First, we have to add a field to validate it. After you install and activate Flexible Checkout Fields plugin, go to WooCommerce → Checkout Fields and in Add New Field section choose Single Line Text. Next, input a label and click on Add Field button. 

Add EU Vat field in WooCommerce checkout page

How to add EU VAT number validation in WooCommerce

When you have your VAT field, time to add proper validation. That means that WooCommerce will check if customers’ VAT number is valid based on EU regulations. In this case, I have to make my own validation, because Flexible Checkout Fields has only email, phone number and postal code validation built in its core.

To add new validation to WooCommerce you have to add code that is displayed below to your functions.php file. 

When you have your functions.php file updated, you can add a validation. Again, go to WooCommerce → Checkout Fields, and see the field added before. In the Validation section, you should see your new custom validation. 

EU VAT number validation in WooCommerce

Choose your validation and click on Save Changes.

Let’s try it out.

If I’ll enter not a valid EU VAT number field on the checkout page, I should see a proper error notice.

invalid EU VAT number notice in WooCommerce

If the EU VAT number is correct, the order will be placed without any problems.Different ways to add EU VAT number validation in WooCommerce

As you can see, the way I presented is for more advanced customers. But there is another solution. You could use Flexible Invoices plugin, that has build validation. Check out our article, where you can find more information about 3 easy ways to add a VAT number field in WooCommerce. Thanks to the premium Flexible Invoices WooCommerce plugin's functionalities you may use VIES validation of VAT EU numbers when selling digital products. You can read how to invoice in the European Union using WooCommerce to see how the plugin in action.

Tweet

2 minutes read5197 views

Bartosz Gajewski

Content Specialist in WP Desk. He tries to increase the number of plugin users with useful content. Privately an enthusiast of mountains and European cinema.

Powered by WP Desk

WP Desk brings you great WooCommerce plugins. We strive to save your time and money by speeding up your processes. Use our plugins to build a better store. Awesome support included in the package.

Premium WooCommerce Plugins →

Stay updated on our how-to articles

WP Desk news, WooCommerce tips, promo codes - right to your inbox.

By entering your e-mail, you agree to our Terms & Conditions and Privacy Policy.

WP Desk › Plugin Tutorials › EU VAT number validation in WooCommerce

Footer

WP Desk - WooCommerce Plugins

At WP Desk we create great WooCommerce plugins with awesome support. Save time and money with our e-commerce solutions. See how we can help you improve your e-store →

Secured by Comodo

WP Desk

  • About us
  • Giving Back
  • Blog
  • Contact us

Products

  • Premium Plugins
  • FAQ
  • Docs
  • Get Support
  • Octolize

Legal

  • Terms & Conditions
  • Refund Policy
  • Support Policy
  • Privacy Policy

© 2022 WP Desk