CheckoutWoocommerce

Add a Free tag when shipping method costs zero

Add a Free tag when shipping method costs zero
    
// Replace the price with "FREE" for the free shipping method add_filter( 'woocommerce_cart_shipping_method_full_label', 'wpsnippetclub_add_free_to_shipping_label', 9999, 2 ); function wpsnippetclub_add_free_to_shipping_label( $label, $method ) { if ( ! ( $method->cost > 0 ) ) { $label .= ': <span class="woocommerce-Price-amount amount" style="color: #ff3535ff;">FREE</span>'; } return $label; }

Leave a Reply