小编Kra*_*ray的帖子

WooCommerce 免费送货 - 在结帐和电子邮件中删除原始名称或更改文本名称

我在 WP 4.5.3 和悉尼模板上运行 WooCommerce 2.6.2。

在 WooCommerce 结帐页面(订单已完成)下的订单详细信息,我想将“免费送货”文本更改为其他内容,或删除此行。

我还想从发送给客户的电子邮件中更改或删除此行。

但是,我无法翻译此文本

我已将此添加到我的functions.php

// Add this to your functions.php
add_filter('gettext', 'translate_reply');
add_filter('ngettext', 'translate_reply');

function translate_reply($translated) {
$translated = str_ireplace('Free Shipping', 'TBD', $translated);
return $translated;
}
Run Code Online (Sandbox Code Playgroud)

但它不起作用。也就是说,如果我只更改“运输”,那么它会翻译运输标签。我不想翻译标签,我想翻译实际的运输方式名称。

这真的令人沮丧。改变一段文字应该不难。

我怎样才能做到这一点?

php wordpress checkout shipping woocommerce

1
推荐指数
1
解决办法
5457
查看次数

标签 统计

checkout ×1

php ×1

shipping ×1

woocommerce ×1

wordpress ×1