mirror of
https://gh.wpcy.net/https://github.com/mainwp/Code-Snippets-Functions.git
synced 2026-04-29 11:32:21 +08:00
8 lines
394 B
Text
8 lines
394 B
Text
function wc_custom_show_free_label_with_free_shipping( $label, $method ) {
|
|
// if ( $method->method_id == 'local_pickup' ) return $label; // Don't apply to local pickup rates
|
|
if ( $method->cost == 0 ) {
|
|
$label .= ' (' . __( 'Free', 'woocommerce' ) . ')';
|
|
}
|
|
return $label;
|
|
}
|
|
add_filter( 'woocommerce_cart_shipping_method_full_label', 'wc_custom_show_free_label_with_free_shipping', 10, 2 );
|