Make required false in woocommerce state field wordpress

 

add_filter( ‘woocommerce_billing_fields’, ‘wc_cf_filter_state’, 10, 1 );

function wc_cf_filter_state( $fields ) {
$fields [‘billing_state’][‘required’] = false;
return $fields ;
}

Leave a Comment

Your email address will not be published. Required fields are marked *