如何在woocommerce结帐的订单收到页面上更改送货地址和帐单地址的文本? [英] How to change text of shipping address and billing address on order recieved page of woocommerce checkout?
问题描述
我正在使用 woocommerce 在 wordpress 中创建商店.我已通过以下代码将帐单明细文本更改为运输明细,反之亦然
I am using woocommerce for create shop in wordpress. i had change text of billing details to shipping details and vice versa through following code
function wc_custom_addresses_labels( $translated_text, $text, $domain )
{
switch ( $translated_text )
{
case 'Billing Address' : /* Front-end */
$translated_text = __( 'Shipping Address', 'woocommerce' );
break;
case 'Billing Details' : // Back-end
$translated_text = __( 'Shipping Detail', 'woocommerce' );
break;
case 'Ship to a different address?' :
$translated_text = __( 'Bill to a different address?', 'woocommerce' );
break;
case 'Shipping Details' : // Back-end
$translated_text = __( 'Billing Detail', 'woocommerce' );
break;
}
return $translated_text;
}
add_filter( 'gettext', 'wc_custom_addresses_labels', 20, 3 );
但在此之后订单收到页面
But after this on order recieved page
帐单详细信息和送货详细信息具有相同的文本,即送货地址你可以在这里查看 - http://screencast.com/t/BKOYuAg48W
Billing detail and shipping details had same text and that is shipping address you can check here - http://screencast.com/t/BKOYuAg48W
推荐答案
您可以根据需要从主题更改显示.
You can change display according to your need from your theme.
按照链接中的说明进行操作.
Follow instructions in links.
找到 order/order-details.php
文件并通过您的主题编辑此文件...
Find order/order-details.php
file and edit this file via your theme...
这将使覆盖woo-commerce代码和显示变得容易...
This will make easy to overwrite woo-commerce code and display...
这篇关于如何在woocommerce结帐的订单收到页面上更改送货地址和帐单地址的文本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!