Skip to content

Instantly share code, notes, and snippets.

@rayflores
Created September 5, 2017 16:16
Show Gist options
  • Save rayflores/f22b86cc5180d55ef7aa4d251fa68813 to your computer and use it in GitHub Desktop.
Save rayflores/f22b86cc5180d55ef7aa4d251fa68813 to your computer and use it in GitHub Desktop.
Add text to shipping label
<?php
add_filter( 'woocommerce_cart_shipping_method_full_label', 'add_free_to_free_shipping_label', 10, 2);
function add_free_to_free_shipping_label( $label, $method ){
if ( $method->cost === '0.00' ){
$label = $label . ' (Free)';
}
return $label;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment