How to Change WooCommerce Price Display “FREE Instead of $0.00”

How to Change WooCommerce Price Display “FREE Instead of $0.00”

In this article, I am going to tell you how you can change the $0.00 to FREE when a WooCommerce product is discounted from a price to $0. 

Step 1: Login WordPress Admin Dashboard

First I am going to show you an example of how my WooCommerce product price looks like before changing anything. So, I have set a $0 price for one of my products.

See the example image below:

Product Display

Step 2: Change WooCommerce Price Display

In this step, I am going to show you how I can change the WooCommerce price display through code. So I am going to open FileZilla and insert my credentials here.

FTP Credenticials

Next, go to the theme location, for example:

/public_html/wp-content/themes/storefront/functions.php

For further ado, see the screenshot below:

Themes-functions.php file

Next, download functions.php file on your local server and then open it in any text editor.

Then, you just need to drop this code in functions.php file in your theme.

add_filter('woocommerce_get_price_html', 'PriceDisplayFreeWC', 10, 2);
 
function PriceDisplayFreeWC($price, $product) {
	if ( $price == wc_price( 0.00 ) )
		return 'FREE';
	else
		return $price;
}

Save this file and then re-upload on the live site through FTP.

That’s it, the job done. Let’s see how my products page looks like.

Change WooCommerce Price Display $0.00 to FREE

I hope you can now easily change the $0.00 to FREE. If you have any questions feel free to ask me via the comment section below.

How to Change WooCommerce Price Display “FREE Instead of $0.00”

Leave a Reply

Your email address will not be published. Required fields are marked *

Scroll to top