Filter required checkout field code working and not working
-
I’m using WooCommerce with the My Custom Functions plugin. I am trying to make required fields on the checkout page not required. So I have the following Space-X Chimp code:
add_filter( ‘woocommerce_billing_fields’, ‘wc_npr_filter_phone’, 10, 1 );
function wc_npr_filter_phone( $address_fields ) {
$address_fields[‘billing_address_1’][‘required’] = false;
$address_fields[‘billing_phone’][‘required’] = false;
$address_fields[‘billing_country’][‘required’] = false;
return $address_fields;
}It works for the phone and the country but not for the street address. I am a newbie with this kind of code. Any ideas as to why street address is still required on my checkout page?
- The topic ‘Filter required checkout field code working and not working’ is closed to new replies.