Por padrão, o WooCommerce exibe o frete grátis com o preço zerado e, em alguns casos, simplesmente não exibe nada, ficando apenas o nome do método.

Isso causa confusão em muitos clientes por não entenderem que o frete é grátis nesses casos. Com o snippet abaixo é possível resolver este problema.
This file contains 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
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; | |
} |
O resultado será este:

No plugin Simulador de Frete o preço também aparece como R$ 0,00 em vez de “Frete grátis”, você pode resolver isso com o código a seguir:
This file contains 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
add_filter( 'wc_simulador_frete_method_cost', 'wc_simulador_frete_show_text_when_free', 10 ); | |
function wc_simulador_frete_show_text_when_free( $html_cost ) { | |
if ( wc_price( 0 ) === $html_cost ) { | |
return 'Grátis!'; | |
} | |
return $html_cost; | |
} |
O resultado será este:
