Skip to content

Instantly share code, notes, and snippets.

@justinstern
Created March 11, 2014 05:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save justinstern/9480084 to your computer and use it in GitHub Desktop.
Save justinstern/9480084 to your computer and use it in GitHub Desktop.
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