Making State field a not required field
-
Could someone explain how to make both shipping and billing State fields non required fields? This is what I tried. It does work but it also adds two blank fields to both billing and shipping address sections
add_filter( 'woocommerce_billing_fields', 'wc_npr_filter_state', 10, 1 ); add_filter( 'woocommerce_shipping_fields', 'wc_npr_filter_state', 10, 1 ); function wc_npr_filter_state( $address_fields ) { $address_fields['billing_state']['required'] = false; $address_fields['shipping_state']['required'] = false; return $address_fields; }
Many thanks in advance.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Making State field a not required field’ is closed to new replies.