|
/ Documentation /CartFlows/Code Snippets/ VAT Field of WooCommerce EU/UK VAT Compliance (Premium) Plugin is not Displaying

VAT Field of WooCommerce EU/UK VAT Compliance (Premium) Plugin is not Displaying

If you’re using the WooCommerce EU/UK VAT Compliance (Premium) plugin by David Anderson and the VAT field is not appearing on your CartFlows Checkout page, this documentation will help you display it correctly.

This plugin adds a VAT number field on the WooCommerce checkout page to support tax compliance for EU and UK customers. However, due to how CartFlows customizes the checkout fields, the VAT field may not display by default.

Ensure VAT Field is Displayed on WooCommerce Checkout

Before checking CartFlows compatibility, make sure the VAT field is visible on the default WooCommerce checkout page. If it’s not displayed there, it won’t appear on CartFlows either.

You can confirm this by temporarily switching to the default WooCommerce checkout page and testing whether the VAT field appears as expected.

Why the Field Might Not Show on CartFlows Checkout

CartFlows customizes the WooCommerce checkout form, including billing and shipping fields, using standard WooCommerce hooks and filters. Because of this, fields added by third-party plugins may not always appear in the intended position.

Fortunately, the WooCommerce EU/UK VAT Compliance (Premium) plugin provides a filter that allows you to change the position of the VAT field.

Add the Filter to Display VAT Field on CartFlows Checkout

Add the following filter to your child theme’s functions.php file:

add_filter( 'wc_eu_vat_number_position', 'eu_change_vat_number_position', 10, 1 ); 

/**
* Function to change the position of VAT field only for the CartFlows checkout page.
* 
* @param $current_page current visited page
* @return $current_page current page.
*/
function eu_change_vat_number_position( $position ){

  /* Get global post object */
	global $post;

	/* Get current post type */
	$post_type = get_post_type();
	
	/* Check the current type of the page */
	$is_checkout = get_post_meta( $post->ID, 'wcf-step-type', true );
		
	/* Change position only of the CartFlows checkout page */
	if( 'cartflows_step' == $post_type && 'checkout' === $is_checkout){
		$position = 'woocommerce_after_order_notes';
	}

  return $position;

}

💡 Need help adding custom code? Here’s how to safely add custom snippets to your site.

After adding this filter, the VAT field will display on your CartFlows checkout page in the correct position. If you’ve followed the steps and the field still doesn’t appear, double-check your plugin settings and ensure the field is visible on the standard WooCommerce checkout.

Was this doc helpful?
What went wrong?

We don't respond to the article feedback, we use it to improve our support content.

Need help? Contact Support
On this page