How to make ‘Province’ field unrequired in woocommerce checkout page?

I am working on an e-commerce website built in woocommerce. When a customer placed an order, he/she is required to enter a province in the billing address in the checkout page. It is by default set to ‘Required’ by Woocommerce. but I don’t want it to be compulsory. How can I ‘Unrequired’ the province field in the checkout page? Please help.

Related posts

1 comment

  1. I don’t think the “province” is a default woocommerce checkout field, but here is an example you can use if you know the right “province” field name :

    insert this into your functions.php file inside your WordPress theme.

    add_filter( 'woocommerce_billing_fields', 'wc_cf_filter_state', 10, 1 );
    
    function wc_cf_filter_state( $fields ) {
        $fields ['billing_state']['required'] = false;
        return $fields ;
    }
    

Comments are closed.