Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
German Market - Filter - USTID Pflichtfeld
// Vat Number field is required in checkout
add_filter( 'woocommerce_billing_fields', 'my_woocommerce_billing_fields_vat_nr_is_required' );
/**
* Vat Number field is required in checkout
*
* @author MarketPress
* @wp-hook woocommerce_billing_fields
* @param Array $address_fields
* @return Array
**/
function my_woocommerce_billing_fields_vat_nr_is_required( $address_fields ) {
if ( isset( $address_fields[ 'billing_vat' ] ) ) {
$address_fields[ 'billing_vat' ][ 'required' ] = true;
}
return $address_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.