Fix: WooCommerce EU VAT number v2.3.23 doesn’t autofill the Vat Number field in checkout

I ran into this problem with a couple of WooCommerce websites I maintain. During checkout, the field for VAT Number is not automatically filled in for logged in users, in spite of the VAT Number being present in the database.

WooCommerce support assured me this will be fixed in a next release, in the meantime, you can use this quick fix:

add_filter( 'woocommerce_checkout_fields', function( $fields ) {
  $fields['billing']['billing_vat_number']['default'] = get_user_meta( get_current_user_id(), 'vat_number', true );
  return $fields;
});

Geef een reactie

Het e-mailadres wordt niet gepubliceerd. Vereiste velden zijn gemarkeerd met *

Overtuigd?

Neem dan contact op voor een offerte of vrijblijvend gesprek.
Stuur een e-mail naar [email protected] of maak gebruik van het contactformulier.