How to remove the text (Free) from Local Pickup in

2019-08-04 01:55发布

How to remove the text (Free) from Local Pickup (Free) in shopping cart page in WooCommerce? I'm using IDStore theme.

Many thanks, MT

2条回答
\"骚年 ilove
2楼-- · 2019-08-04 02:17

add to 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;
}
查看更多
家丑人穷心不美
3楼-- · 2019-08-04 02:21

Add this code in your theme's functions.php file

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;
}
查看更多
登录 后发表回答