WooCommerce customization – How to display Free instead of zero

woocommerce-customization

If you are using WooCommerce which is by far  my E-Commerce plugin of choice for WordPress , then sometimes you’ll run into the issue where you want to use the word “FREE” as the price when a product price is  set to $0.

Here is the code to do it,  just drop it into your functions.php file in your theme.

add_filter('woocommerce_free_price_html', 'changeFreePriceNotice', 10, 2);

function changeFreePriceNotice($price, $product) {
	return 'FREE';
}

WooCommerce customization – How to display Free instead of zero

 

Nikola Petrovic
Get in Touch

Nikola Petrovic

Hi there. My name is Nikola,
I speak English, Greek and Serbian.
As a Web Producer i can deal with almost anything web design & development related.
As a freelancer, I charge only a small portion of the money you would pay to agencies to create your website. Affordable web design doesn’t mean that it will lack any of the advanced features of today’s web technology. We just cut out the cost of the middle man.
Feel free to request a free quote using the form on the right or the one bellow.
Nikola Petrovic
Get in Touch