When you list products on your WooCommerce store, showing a price of $0.00 might not be the most effective way to communicate value to your customers. Instead, displaying the term “Free” can be more appealing and clearer. This tutorial will walk you through the process of using a code snippet to make this change.
Prerequisites
Please make sure you have the following installed and activated:
To change the display from $0.00 to “Free” on your WooCommerce products, follow these steps:
- Navigate to
Snippets > Add New
and name it “Set 0 Prices to be Free”. - Copy the code:
/** * Snippet Name: WooCommerce Change "$0.00" to "Free" * Snippet Author: ecommercehints.com */ add_filter( 'woocommerce_get_price_html', 'ecommercehints_change_zero_price_display', 10, 2 ); function ecommercehints_change_zero_price_display( $price, $product ) { if (empty($product->get_price()) || $product->get_price() == 0) { // If price is not entered or set to 0 $price = __( 'Free', 'woocommerce' ); } return $price; }
Source: Code Snippets
- Paste the code into the new snippet area.
- Save changes and activate the snippet.
Once activated, any product priced at $0.00 will now display as “Free”. If you prefer a different term, such as “Free Product”, you can modify the code snippet accordingly.
Conclusion
With a simple code snippet, you can enhance the customer experience by clearly indicating when a product is available for free. This small change can make a significant difference in how customers perceive the value you’re offering.