如何修改 Woocommerce 运输标签 [英] How can I modify a Woocommerce shipping label

查看:38
本文介绍了如何修改 Woocommerce 运输标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在创建一个 Wordpress Woocommerce 网站.我需要让国际统一运费说致电我们询问费率"而不是国际运费(免费)".我可以在更新此文本的管理端更改的唯一值是添加价格.无法添加标签或更改价格或免费文本.

I am creating a Wordpress Woocommerce site. I need to have the International Flat Rate Shipping say "Call Us For Rates" instead of "International Shipping (Free)". The only value that I can change on the admin side that updates this text is to add a price. There is no way to add a label or change the price or free to text.

谁能建议一种方法来做到这一点?

Can anyone suggest a way to do this?

推荐答案

您可以使用woocommerce_cart_shipping_method_full_label 过滤器.

将以下代码添加到您的主题 functions.php(最好是子主题)

Add the following code to your theme functions.php (preferably a child-theme)

add_filter( 'woocommerce_cart_shipping_method_full_label', 'change_shipping_label', 10, 2 );

function change_shipping_label( $full_label, $method ){

    $full_label = str_replace( "International Shipping (Free)", "Call Us For Rates", $full_label );

    return $full_label;
}

这篇关于如何修改 Woocommerce 运输标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆