Black Friday & Cyber Monday SUPER SALE ALL WEEK:
Grab 40% OFF on plugins
Days
Hours
Minutes
Seconds

How to Display $0.00 Amount For Free Shipping Rates in WooCommerce?

Instead of just showing Free shipping, you can clearly show the price $0.00 beside shipping rates with this simple code snippet.

add_filter( 'woocommerce_cart_shipping_method_full_label', 'ts_add_0_to_shipping_label', 9999, 2 );
 
function ts_add_0_to_shipping_label( $label, $method ) {
   if ( ! ( $method->cost > 0 ) ) {
      $label .= ': ' . wc_price( 0 );
   }
   return $label;
}
 
add_filter( 'woocommerce_order_shipping_to_display', 'ts_add_0_to_shipping_label_ordered', 9999, 3 );
 
function ts_add_0_to_shipping_label_ordered( $shipping, $order, $tax_display ) {
   if ( ! ( 0 < abs( (float) $order->get_shipping_total() ) ) && $order->get_shipping_method() ) {
      $shipping .= ': ' . wc_price( 0 );
   }
   return $shipping;
}

Output

This code modifies the display of shipping labels in WooCommerce by adding “: $0.00” to the labels for shipping methods with a cost of zero on both the cart page and checkout page.

How to Display $0.00 Amount For Free Shipping Rates in WooCommerce?

The below output displays the default shipping rates that were displayed before applying the code.

How to Display $0.00 Amount For Free Shipping Rates in WooCommerce?


Additionally, you can also sort shipping methods costs as per your need. Look into our post that will help you to sort WooCommerce shipping options by ascending cost with free shipping at the end.

Browse more in: Code Snippets, WooCommerce How Tos, WooCommerce Tutorials

Share It:

Subscribe
Notify of
0 Comments
Newest
Oldest
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x