简体   繁体   English

我如何在Woocommerce我的帐户/编辑地址中更改TEXT

[英]How can i change TEXT in Woocommerce my-account/edit-address

How can I edit the text in WooCommerce my-account/edit-address. 如何在WooCommerce我的帐户/编辑地址中编辑文本。 I would like to change it from Shipping address to ( Delivery address) 我想将其从收货地址更改为(收货地址)

Current text: You have not set up this type of address yet. 当前文本:您尚未设置此类型的地址。 ( Shipping Address) ( 送货地址)

Change the text to: You have not set up this type of address yet. 将文本更改为:您尚未设置这种类型的地址。 ( Delivery Address) ( 邮寄地址)

You need to make copy of below mention files to your active theme : 您需要将以下提及的文件复制到活动主题:

Copy These Files From -> 从->复制这些文件

  1. wp-content/plugins/woocommerce/myaccount/my-address.php wp-content / plugins / woocommerce / myaccount / my-address.php
  2. wp-content/plugins/woocommerce/myaccount/form-edit-address.php wp-content / plugins / woocommerce / myaccount / form-edit-address.php

TO ( Paste Both Files Here ) -> wp-content/themes/(ActiveThemeFolder)/woocommerce/myaccount/ TO(将两个文件都粘贴到这里)-> wp-content / themes /(ActiveThemeFolder)/ woocommerce / myaccount /

Then Rename "Shipping address" To "Delivery Address" by following below mention way in theme files. 然后按照以下主题文件中的提及方式将“送货地址”重命名为“送货地址”。

Edit ( my-address.php ) - 编辑(my-address.php)-

$get_addresses = apply_filters( 'woocommerce_my_account_get_addresses', array(
'billing' => __( 'Billing address', 'woocommerce' ),
'shipping' => __( 'Shipping address', 'woocommerce' ),
), $customer_id );

To

$get_addresses = apply_filters( 'woocommerce_my_account_get_addresses', array(
'billing' => __( 'Billing address', 'woocommerce' ),
'shipping' => __( 'Delivery address', 'woocommerce' ),
), $customer_id );

Edit ( form-edit-address.php ) - 编辑(form-edit-address.php)-

$page_title = ( 'billing' === $load_address ) ? __( 'Billing address', 'woocommerce' ) : __( 'Shipping address', 'woocommerce' ); 

To

$page_title = ( 'billing' === $load_address ) ? __( 'Billing address', 'woocommerce' ) : __( 'Delivery address', 'woocommerce' );

Just add the follows code snippet in your active theme's functions.php - 只需在活动主题的functions.php中添加以下代码片段-

function change_woocommerce_my_account_get_addresses( $addresses ){
    if( isset( $addresses['shipping'] ) ) $addresses['shipping'] = __( 'Delivery address', 'your-text-domain' );
    return $addresses;
}
add_filter( 'woocommerce_my_account_get_addresses', 'change_woocommerce_my_account_get_addresses' );

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

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