How to remove the text (Free) from Local Pickup in shopping cart page in WooCommerce

◇◆丶佛笑我妖孽 提交于 2019-12-11 08:13:36

问题


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

Many thanks, MT


回答1:


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;
}



回答2:


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;
}


来源:https://stackoverflow.com/questions/21304543/how-to-remove-the-text-free-from-local-pickup-in-shopping-cart-page-in-woocomm

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!