checkout page field rename in woocommerce

I am trying to rename the field text on checkout page woocommerce this is the code which i am using.

add_filter( 'woocommerce_checkout_fields' , 'custom_override_checkout_fields' );


function custom_override_checkout_fields( $fields ) {
     $fields['billing']['billing_address_1']['label'] = 'Address (No PO Boxes)';

     return $fields;
}

Now what the issue is while uploading page Address (No PO Boxes) is showing but the page load fully it start shows Address again i am confused why it is showing like that

Related posts

1 comment

  1. I got an answer i update the label in woocommerce/includes/class-ec-countries.php. There you can see the code on line no.509 code will be in array

    'address_1' => array(
                'label'       => __( 'Address', 'woocommerce' ),
                'placeholder' => _x( 'Street address', 'placeholder', 'woocommerce' ),
                'required'    => true,
                'class'       => array( 'form-row-wide', 'address-field' )
            ),
    

    i changes the Address with my required text and it is now working awesome

Comments are closed.