Something I have had to work with 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:
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
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 and you are done.
