Hello, I have searched and see there are many threads on this, but I need to make absolutely sure please.
I have to add some code to virtue theme’s functions.php file to stop woocommerce outputting FREE on table rate shipping with no set price (third party plugin)
If I create a virtue child theme and add just this code to a new functions.php file in the child theme, will updates of the parent theme still work ok, and will/should the present site continue to work as now? (virtue-woocommerce)
or.. is there another way of doing this?
Thank you, John
——————————–
When a shipping rate is free and not given through the Free Shipping method provided by WooCommerce, it automatically adds the bit (Free) to the end of the label. To remove this, add the follow code to your theme’s functions.php file.
add_filter( ‘woocommerce_cart_shipping_method_full_label’, ‘remove_free_from_shipping_label’, 10, 2 );
function remove_free_from_shipping_label($full_label, $method){
return str_replace(‘ (‘ . __( ‘Free’, ‘woocommerce’ ) . ‘)’, “”, $full_label);
}
Note: This code will only work for WooCommerce 2.1 and recent versions