Monday 31 August 2015

How to Hide WooCommerce "Free" Price Label

A common WooCommerce question lately has been how to hide the “Free” price label in the product/category/shop pages. Thanks to WooCommerce’s judicious use of filters/actions, this is very easy
request, yet if you’re new to WordPress/WooCommerce you might not necessarily know exactly where to look. Well look no further, because here’s an easy way to suppress that “Free” notice for regular/variable products:

add_filter( 'woocommerce_variable_free_price_html''hide_free_price_notice' );
add_filter( 'woocommerce_free_price_html',           'hide_free_price_notice' );
add_filter( 'woocommerce_variation_free_price_html', 'hide_free_price_notice' );
/**
 * Hides the 'Free!' price notice
 */
function hide_free_price_notice( $price ) {
  return '';
}

Simply add the above to your theme’s functions.php in the usual manner (theme-name/functions.php), or perhaps to your custom site plugin and you should be “Free” price label free!

4 comments:

  1. I am very happy to see your blog,

    good article and interesting,

    *reach your marketing lists or Sales

    Leads*

    Email Appending list is continuously

    updated with most accurate, quality

    and verified contacts.

    Ehealthcarelists can provide WOO COMMERCE Users

    Email
    complete marketing

    information such as

    · First Name, Last Name
    · Business Name
    · Practice Specialty, Specialty Code
    · Email, Postal Address and Zip Code
    · SIC /NAICS Code and NPI Numbers.
    · Phone Number and Fax Number
    · License Number
    · Web address

    Thanks for the information and

    Greetings

    ReplyDelete
  2. Can you tell me exactly where to add in my theme. I does not work on my shop. Thank you

    ReplyDelete
  3. Create a Company profile on findoble.com 100% free, and get high rating & reviews of your company.
    findoble is best blogger and reviews portal in world

    ReplyDelete

Popular Articles