Last active
June 23, 2017 04:25
-
-
Save WPprodigy/273f49b8084dd04af40dacd4394fca5a to your computer and use it in GitHub Desktop.
Rename the flat rate shipping label when the cost is $0
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Rename the flat rate shipping label when the cost is $0 | |
function wc_ninja_change_flat_rate_label( $label, $method ) { | |
if ( 'flat_rate' == $method->method_id && $method->cost <= 0 ) { | |
$label = "Free Shipping"; | |
} | |
return $label; | |
} | |
add_filter( 'woocommerce_cart_shipping_method_full_label', 'wc_ninja_change_flat_rate_label', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment