• Hi,

    How can I hide “stat” field on checkout page? Or make not required?

    I tried this code, but doesnt work.

    add_filter( 'woocommerce_billing_fields', 'woo_filter_state_billing', 10, 1 );
    add_filter( 'woocommerce_shipping_fields', 'woo_filter_state_shipping', 10, 1 );
    
    function woo_filter_state_billing( $address_fields ) {
    	$address_fields['billing_state']['required'] = false;
    	return $address_fields;
    }
    
    function woo_filter_state_shipping( $address_fields ) {
    	$address_fields['shipping_state']['required'] = false;
    	return $address_fields;
    }

    Kind Regards
    Peter

    https://www.ads-software.com/plugins/woocommerce/

Viewing 1 replies (of 1 total)
  • Plugin Contributor Mike Jolley

    (@mikejolley)

    Is there a certain country you don’t need states? We can update the locale files if needed..

Viewing 1 replies (of 1 total)
  • The topic ‘Make hidden "state" field or not required on checkout’ is closed to new replies.