In the past, WooCommerce cart and checkout pages used to show “$0.00” beside each free shipping rate. But given that many freelance clients requested this customization, today we’re bringing this back to life with just a few lines of PHP 🙂

WooCommerce: display 0 amount beside free shipping rates at cart & checkout

PHP Snippet: Display $0.00 Amount For Free Shipping Rates @ WooCommerce Cart & Checkout


/**
 * @snippet       Display $0.00 Amount For Free Shipping Rates @ WooCommerce Cart & Checkout
 * @how-to        Get CustomizeWoo.com FREE
 * @sourcecode    https://businessbloomer.com/?p=72869
 * @author        Rodolfo Melogli
 * @testedwith    WooCommerce 3.1.2
 */

add_filter( 'woocommerce_cart_shipping_method_full_label', 'bbloomer_add_0_to_shipping_label', 10, 2 );
  
function bbloomer_add_0_to_shipping_label( $label, $method ) {

// if shipping rate is 0, concatenate ": $0.00" to the label
if ( ! ( $method->cost > 0 ) ) {
$label .= ': ' . wc_price(0);
} 

// return original or edited shipping label
return $label;

}

Share:

Leave a Reply