Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Remove the Billing VAT field from the checkout form only for Wholesalers.
/**
* Remove the Billing VAT field from the checkout form only for Wholesalers.
*/
function custom_override_checkout_fields( $fields ) {
if ( ! current_user_can( 'wholesalers' ) && isset( $fields['billing']['billing_vat'] ) ) {
unset( $fields['billing']['billing_vat'] );
}
return $fields;
}
add_filter( 'woocommerce_checkout_fields' , 'custom_override_checkout_fields' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.