Skip to content

Instantly share code, notes, and snippets.

@woogist
Created December 24, 2014 11:17
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save woogist/4fb6c1e6e817dc874fc3 to your computer and use it in GitHub Desktop.
Save woogist/4fb6c1e6e817dc874fc3 to your computer and use it in GitHub Desktop.
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