如何从WooCommerce的购物车页面中的本地提货中删除文本(免费)

时间:2014-01-23 09:47:54

标签: woocommerce local

如何在WooCommerce的购物车页面中删除本地取件(免费)中的文字(免费)?我正在使用IDStore主题。

非常感谢, MT

2 个答案:

答案 0 :(得分:2)

在主题的functions.php文件中添加此代码

add_filter( 'woocommerce_cart_shipping_method_full_label', 'remove_local_pickup_free_label', 10, 2 );
function remove_local_pickup_free_label($full_label, $method){
    if( $method->id == 'local_pickup' )
    $full_label = str_replace("(Free)","",$full_label);
  return $full_label;
}

答案 1 :(得分:0)

添加到functions.php

add_filter( 'woocommerce_cart_shipping_method_full_label', 'remove_local_pickup_free_label', 10, 2 );
function remove_local_pickup_free_label($full_label, $method){
    if( $method->id == 'local_pickup' ) $full_label = 'Local Pickup';
    return $full_label;
}