Created
March 6, 2017 12:16
-
-
Save twern/809e7e353b862c661ec35bf2ccde6c48 to your computer and use it in GitHub Desktop.
German Market - Filter - USTID Pflichtfeld
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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