Vimeo for WooCommerce

Adder by PM

Pinterest for WooCommerce

Added by Team Desire

WisePad 3 banner

Validate VAT number on the account details page

The VAT number is only validated on the checkout page by this plugin. It’d be reasonable to validate it on the account details (my-account/edit-account) page for customers, too.

Alternatively, you could make $wc_eu_vat_my_account a global and then the following snippet would implement what I’m advising.

add_action(‘woocommerce_save_account_details’, function ($id) {
global $wc_eu_vat_my_account;
try {
$user = get_userdata($id);
$wc_eu_vat_my_account->validate($_POST[‘vat_number’], $user->billing_country);
update_user_meta($id, ‘vat_number’, $_POST[‘vat_number’]);
} catch (Exception $e) {
wc_add_notice($e->getMessage(), ‘error’);
}
}, 12);

Current Status

Open

Last updated: April 7, 2022

0 comments

Log in to comment on this feature request.

WooCommerce

The most customizable eCommerce platform for building your online business.

  • 30 day money back guarantee
  • Support teams across the world
  • Safe & Secure online payment