WooCommerce - Overriding billing state and post code on existing checkout fields
<p>I can't find the way to ovveride billing state and post code.</p>

<p>How can I edit the other parts of existing billing fields like billing state and post code?</p>

<p>This is what I have in the <strong><code>functions.php</code></strong> file in my child theme (I have included the code affecting the billing part):</p>

<pre><code>    &lt;?php
function my_custom_checkout_field( $checkout ) {
  global $wpdb;
  $check_zone  = $wpdb-&gt;get_results("select area_name from brick_area where id='".$_SESSION['area']."'",ARRAY_A);

                if(!empty($check_zone)){
                    $check_zoneid = $check_zone['0'];
                }


    woocommerce_form_field( 'my_field_name', array(
        'type'          =&gt; 'text',
        'class'         =&gt; array('my-field-class form-row-wide'),
        'label'         =&gt; __('Delivery Area'),
        'placeholder'   =&gt; __('Area'),
        'readonly'      =&gt;'readonly',
        'default'       =&gt; $check_zoneid['area_name']
        ), $checkout-&gt;get_value( 'my_field_name' ));


    woocommerce_form_field( 'my_expected_date', array(
        'type'          =&gt; 'text',
        'class'         =&gt; array('my-field-class form-row-wide'),
        'required'      =&gt; true,
        'label'         =&gt; __('Expected Delivery Date'),
        'placeholder'   =&gt; __('Enter expected delivery date.'),
        ), $checkout-&gt;get_value( 'my_expected_date' ));

   /*woocommerce_form_field( 'my_expected_time', array(
        'type'          =&gt; 'text',
        'class'         =&gt; array('my-field-class form-row-wide'),
        'required'      =&gt; true,
        'label'         =&gt; __('Expected Delivery Time'),
        'placeholder'   =&gt; __('Enter expected delivery time.'),
        ), $checkout-&gt;get_value( 'my_expected_time' ));*/

    woocommerce_form_field( 'site_contact_name', array(
        'type'          =&gt; 'text',
        'class'         =&gt; array('my-field-class form-row-wide'),
        'required'      =&gt; true,
        'label'         =&gt; __('Site Contact Person Name'),
        'placeholder'   =&gt; __('Enter site contact person name.'),
        ), $checkout-&gt;get_value( 'site_contact_name' ));    

    woocommerce_form_field( 'site_contact_phone', array(
        'type'          =&gt; 'tel',
        'class'         =&gt; array('my-field-class form-row-wide'),
        'required'      =&gt; true,
        'label'         =&gt; __('Site Contact Phone Number'),
        'placeholder'   =&gt; __('Enter site contact phone number.'),
        ), $checkout-&gt;get_value( 'site_contact_phone' ));       

}
        $fields['billing']['billing_city']['default'] = $_SESSION['cn'];
        add_filter( 'woocommerce_default_address_fields' , 'custom_override_default_address_fields' );
        function custom_override_default_address_fields( $address_fields ) {

            // we are changing here billing_state field to required
            $fields['billing']['billing_state']['required'] = true;

            return $address_fields;
        }
        /*$fields['billing']['my_field_name']['default'] = $check_zoneid['area_name'];
        $fields['billing']['my_field_name']['label'] = 'Area';*/

        return $fields;
        }
 ?&gt;      
</code></pre>

<p>Thanks</p>