• Skip to primary navigation
  • Skip to main content
Matthew Dunbar

Matthew Dunbar

Hire Me
  • About
  • Portfolio
  • Blog
    • General
    • HTML
    • jQuery
    • PHP
    • Optimization
  • Hire Me
You are here: Home / Archives for jQuery

jQuery

How to Replace $0.00 to Free in Woocommerce 3.0 Update – 2017

April 14, 2017

Woocommerce updated to 3.0 this April and with it came a bunch of core changes.

Before this update, products priced at $0.00 would display as “Free” on their product pages. Developers would change this text to read something else like “Call for Pricing”. However, with the Woocommerce update, these products now display as $0.00 instead of text (see first image below).

To change the $0.00 price tag to Free, or any other text, we’ll use jQuery. This will only change the price for the viewer, so when an order comes in, it will still be priced at $0.00.

Simply paste the code below to your custom scripts file or in the theme’s “Footer Scripts” area.


<script>
$(".woocommerce-Price-amount").text(function () {
    return $(this).text().replace("$0.00", "Free"); 
});
</script>

Before

After

Filed Under: jQuery, WooCommerce

  • Page 1
  • Page 2
  • Page 3
  • Interim pages omitted …
  • Page 8
  • Go to Next Page »
© 2025 Matthew Dunbar - All Rights Reserved Back to Top