简体   繁体   English

woocommerce中的结帐页面字段重命名

[英]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. 我正在尝试重命名结帐页面woocommerce上的字段文本,这是我正在使用的代码。

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 现在,上传页面Address (No PO Boxes)出现的问题是什么,但页面完全加载后开始显示地址,我很困惑为什么会这样显示

I got an answer i update the label in woocommerce/includes/class-ec-countries.php . 我得到了一个答案,我在woocommerce/includes/class-ec-countries.php更新了标签。 There you can see the code on line no.509 code will be in array 在那里,您可以看到第line no.509代码将位于数组中

'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 我用我需要的文本更改了地址,并且现在可以正常使用了

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM