Can I change where the VAT number field is displayed?

The VAT number field (if it is configured to be displayed) is printed, by default, when the WordPress action woocommerce_checkout_billing is called by your theme, with priority 40. This usually means it appears at the end of the “billing” section.

This can be changed by using a filter – you can change both the action, and the priority. You need to use an action that is called by your theme’s version of the WooCommerce checkout template (if it over-rides the default template), or the default template bundled with WooCommerce.

Note that not all positions are possible. There are assumptions in WooCommerce core, and sometimes in themes, about how the DOM (HTML structure) of the checkout is constructed. The only real way to find out what is possible is for you to experiment. Here is (PHP 5.3+) code that implements the default behaviour:

<?php

add_filter('wc_eu_vat_number_position', function() { return 'woocommerce_checkout_billing'; });

add_filter('wc_eu_vat_number_priority', function() { return 40; });

Please note that we can provide customisation services to order, but that they are not part of standard support upon plugin purchase (beyond these FAQs).

Posted in: WooCommerce EU/UK VAT Compliance