+91 9737971210
info@wordpressdeveloperonline.com
Facebook
Facebook
Twitter
Twitter
Google+
Google+
LinkedIn
LinkedIn
Instagram
Instagram
WORDPRESS DEVELOPER
Menu
  • HOME
  • SERVICES
    • Free WordPress Setup
      • Free WordPress Website Blog
    • Hire WordPress Developer
      • WordPress Emergency Support
      • Hire PHP Developer
      • Hire WooCommerce Developer
      • Woocommerce Customization
      • Fix WordPress Errors
      • Fix WordPress Security
      • Multi Language Website Blog with WPML
    • Online Shopping Website
    • WordPress Theme Development
      • Avada Theme Experts
      • Divi Expert Services
      • Enfold Theme Expert
      • Jupiter Theme Expert
      • X Theme Expert Services
      • NewsPaper Theme Experts Services
    • PSD to WordPress
    • Speed Performance Optimization
    • WordPress Hosting Migration
    • SEO Link Building
  • PACKAGES
    • Speed Optimization Packages
  • WHY WE
    • PORTFOLIO
    • TESTIMONIALS
    • CAREER
  • BLOG
  • CONTACT

WooCommerce add ‘Free’ after a shipping label

September 20, 2018wordpressdeveloperWoocommerce

In WooCommerce old version, it display a ‘Free’ label behind any flat shipping rate but in latest version of WooCommerce there is no inbulit functionality. So here i show you how to add ‘free’ label after shipping label.

Add below line of code in your theme’s functions.php file of your active child theme (or theme) and save the file.

function 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', 'show_free_label_with_free_shipping', 10, 2 );