• Plugins
  • Support
  • Blog
  • About
  • FAQ
Menu
  • Plugins
  • Support
  • Blog
  • About
  • FAQ
$0.00 0 Cart

How to Show Price for a Free Shipping Method in WooCommerce

  • February 19, 2020
  • -
  • Lauri / WP Trio

WooCommerce hides prices for free shipping methods. This may be confusing for customers but fortunately, it’s easy to show the price $0,00 for shipping methods with a short code snippet.

Snippets may be added using functions.php in the theme files or even better, by using Code Snippets plugin.

Here’s the code for showing price for free shipping methods:

<?php
add_filter('woocommerce_cart_shipping_method_full_label', 'snippet_show_zero_price', 10, 2);
function snippet_show_zero_price($label, $method) {
  $label = $method->get_label();

  if ( WC()->cart->tax_display_cart == 'excl' ) {
    $label .= ': ' . wc_price( $method->cost );
    if ( $method->get_shipping_tax() > 0 && WC()->cart->prices_include_tax ) {
      $label .= ' ' . WC()->countries->ex_tax_or_vat() . '';
    }
  } else {
    $label .= ': ' . wc_price( $method->cost + $method->get_shipping_tax() );
    if ( $method->get_shipping_tax() > 0 && ! WC()->cart->prices_include_tax ) {
      $label .= ' ' . WC()->countries->inc_tax_or_vat() . '';
    }
  }

  return $label;
}

 

Add this to functions.php in your theme or by using Code Snippets. Here’s how it should look:

Latest Posts

How Stock Sync Pro Keeps Your Stock in Check
Product Sync vs. Stock Sync: Understanding the Differences
How to Add Payment Method Fee in WooCommerce
Version 2 of Stock Sync – Migration Guide
How to Display “Add $ X to cart and get free shipping” on Checkout

Plugins

WooCommerce Conditional Payments Pro
WooCommerce Conditional Shipping Pro
WooCommerce Product Sync Pro
WooCommerce Stock Sync Pro
30 DAY MONEY BACK GUARANTEE
+6000 HAPPY CUSTOMERS
SUPPORT FROM THE DEVELOPER

WP Trio / BitBot Oy
Flätbackantie 1, 04150 Sipoo
FINLAND
VAT ID: FI28269925

WP Trio

  • Support
  • Blog
  • About
  • FAQ
  • My account
  • Support
  • Blog
  • About
  • FAQ
  • My account

Plugins

  • Plugins
  • Docs
  • Plugins
  • Docs