Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Put this code snippet at the bottom of your theme's functions.php to modify the flat rate shipping label from (Free) to (will be calculated)
<?php
add_filter( 'woocommerce_cart_shipping_method_full_label', 'woocommerce_flat_rate_custom_label', 10, 2 );
function woocommerce_flat_rate_custom_label( $label, $method ) {
if ( 'flat_rate' == $method->id && 0 == $method->cost ) {
$label = $method->label . ' (will be calculated)';
}
return $label;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.