Skip to content

Instantly share code, notes, and snippets.

@fernandoacosta
Last active October 24, 2018 19:54
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 fernandoacosta/ade0200cf28fa51cae0e549428f61348 to your computer and use it in GitHub Desktop.
Save fernandoacosta/ade0200cf28fa51cae0e549428f61348 to your computer and use it in GitHub Desktop.
Exibir frete grátis em vez do preço zerado no frete
add_filter( 'woocommerce_cart_shipping_method_full_label', 'fa_add_free_shipping_label', 10, 2 );
function fa_add_free_shipping_label( $label, $method ) {
if ( $method->get_cost() == 0 ) {
$label = str_replace( wc_price( 0 ), '', $label );
$label .= ' Frete grátis';
}
return $label;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment