OhhMuaOhhMua
  • Home
  • Hosting
    • Best Web Hosting
    • Free Web Hosting
    • VPS Hosting
  • WordPress
    • Solutions & Troubleshooting
    • Installation & Setup
    • Themes & Plugins
    • Security
  • Build PC
    • High-end Builds
    • Mid-range Builds
    • Entry-level Builds
  • Computer
    • Computer Hardware
      • CPU (Processors)
      • GPU (Graphics Cards)
      • Motherboards
      • RAM (Memory)
      • Storage (SSD & HDD)
      • PSU (Power Supply Units)
      • Cases & Cooling
      • Monitors & Peripherals
    • Computer Tips
      • Hardware Tips
      • Software Tips
    • PC Troubleshooting
    • Gaming Errors & Solutions
  • Coupons & Deals
  • Tools
    • veo3 prompt generator
Reading: Change 0 Price or Empty Price to ‘Call for Price’ in WooCommerce
Notification Show More
OhhMuaOhhMua
  • Computer Tips
  • Hosting
  • WordPress
Search
  • Home
  • WordPress
    • Installation & Setup
    • Security
    • Solutions & Troubleshooting
    • Themes & Plugins
    • Troubleshooting
  • Hosting
    • Free Web Hosting
    • VPS Hosting
    • Best Web Hosting
  • Computer Tips
    • PC Troubleshooting
    • Gaming Errors & Solutions
    • Computer Hardware
  • Coupons & Deals
  • veo3 prompt generator
Follow US
Copyright © 2024 ohhmua. All rights reserved.
OhhMua > Blog > WordPress > Solutions & Troubleshooting > Change 0 Price or Empty Price to ‘Call for Price’ in WooCommerce
Solutions & Troubleshooting

Change 0 Price or Empty Price to ‘Call for Price’ in WooCommerce

Admin (Nghia Vo)
Last updated: September 8, 2024 6:16 am
Admin (Nghia Vo)
Share
2 Min Read
Change 0 Price or Empty Price to 'Call for Price' in WooCommerce
Change 0 Price or Empty Price to 'Call for Price' in WooCommerce
SHARE
Contents
Code Explanation:Conclusion:

If you want to change the price of 0 or leave the price field empty to display “Call for price” in WooCommerce, you can refer to the code below.

Code to Change 0 Price or Empty Price to “Call for Price” in WooCommerce

You can add the following code to the functions.php file of your child theme:

add_filter('woocommerce_get_price_html', 'custom_empty_price_message', 10, 2);
function custom_empty_price_message($price, $product) {
    if ($product->get_price() === '' || $product->get_price() == 0) {
        $price = '<span class="webantam-woocommerce-price-contact">Call for Price</span>';
    }
    return $price;
}

Code Explanation:

  • if ($product->get_price() === ” || $product->get_price() == 0): This conditional statement checks whether the product price is either an empty string (meaning you didn’t enter a price) or if the price is 0.
  • $price = ‘Call for Price’; If the above condition is met, this line replaces the product price with the HTML string <span class="webantam-woocommerce-price-contact">Call for Price</span>. This will display the text “Call for Price” on the WooCommerce product page.

Conclusion:

With just a simple code snippet, you can easily solve the issue of changing a 0 price or empty price to display “Call for Price” in WooCommerce. If you encounter any issues during the process, feel free to reach out!


480520387 657957633334779 6814038772835954285 n
Admin (Nghia Vo)

Hi, I’m Nghia Vo: a computer hardware graduate, passionate PC hardware blogger, and entrepreneur with extensive hands-on experience building and upgrading computers for gaming, productivity, and business operations.

As the founder of Vonebuy.com, a verified ecommerce store under Vietnam’s Ministry of Industry and Trade, I combine my technical knowledge with real-world business applications to help users make confident decisions.

I specialize in no-nonsense guides on RAM overclocking, motherboard compatibility, SSD upgrades, and honest product reviews sharing everything I’ve tested and implemented for my customers and readers.

You Might Also Like

SEO in the Age of AI: How to Make Google Understand and Value Your Content

Cannot Fetch Sitemap in Google Search Console

Discovered – Currently Not Indexed in Google Search Console: What It Means & How to Fix It

Why 2 Backlinks per Article Might Be Killing Your SEO

What is Obsidian? Why Developers Love This Note-Taking App

Share This Article
Facebook Twitter Email Print
By Admin (Nghia Vo)
Follow:

Hi, I’m Nghia Vo: a computer hardware graduate, passionate PC hardware blogger, and entrepreneur with extensive hands-on experience building and upgrading computers for gaming, productivity, and business operations.

As the founder of Vonebuy.com, a verified ecommerce store under Vietnam's Ministry of Industry and Trade, I combine my technical knowledge with real-world business applications to help users make confident decisions. I specialize in no-nonsense guides on RAM overclocking, motherboard compatibility, SSD upgrades, and honest product reviews sharing everything I’ve tested and implemented for my customers and readers.
Leave a comment Leave a comment

Leave a Reply Cancel reply

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

Trending

My Google Discover traffic skyrocketed after I did these 10 things
Solutions & Troubleshooting

My Google Discover traffic skyrocketed after I did these 10 things

May 14, 2025
admin wordpress dashboard
Themes & Plugins

Introduction to the WordPress Dashboard: Features, Tools, and Navigation

April 25, 2025
Troubleshooting Boot Issues Upgrading from i7 2600K to i5 12600K
PC Troubleshooting

Troubleshooting Boot Issues: Upgrading from i7-2600K to i5-12600K

September 9, 2025
Change 0 Price or Empty Price to 'Call for Price' in WooCommerce
Solutions & Troubleshooting

Change 0 Price or Empty Price to ‘Call for Price’ in WooCommerce

September 7, 2024
Add Chrome Incognito Mode to Windows 11 Right Click Menu thumbnail
Software Tips

Add Chrome Incognito Mode to Windows 11 Right-Click Menu

September 16, 2025
Building a Budget 1080p Gaming PC with AMD Ryzen 5 8400F and Sparkle Arc B570
Entry-level Builds

Building a Budget 1080p Gaming PC with AMD Ryzen 5 8400F and Sparkle Arc B570

July 22, 2025
Previous Next

You Might Also Like

Optimize WordPress
Solutions & Troubleshooting

Want Faster Load Times? Optimize WordPress This Way

Admin (Nghia Vo) Admin (Nghia Vo) May 16, 2025
How to Add a Read More to Product Descriptions in WooCommerce
Solutions & Troubleshooting

How to Add a “Read More” and “Show Less” Button to Product Descriptions in WooCommerce

Admin (Nghia Vo) Admin (Nghia Vo) May 5, 2025
WordPress Covers Every Website Type
Solutions & Troubleshooting

Blog, E-Commerce, or Forum? WordPress Covers Every Website Type!

Admin (Nghia Vo) Admin (Nghia Vo) April 29, 2025
Optimized Pagination thumbnail
Solutions & Troubleshooting

How I Optimized Pagination and Skyrocketed Traffic

Admin (Nghia Vo) Admin (Nghia Vo) April 28, 2025
How to Pick the Ideal Blogging Platform for Your Needs
Solutions & Troubleshooting

How to Pick the Ideal Blogging Platform for Your Needs

Admin (Nghia Vo) Admin (Nghia Vo) April 1, 2025
Protecting Your WordPress Site from File Upload Vulnerabilities
Solutions & Troubleshooting

Protecting Your WordPress Site from File Upload Vulnerabilities

Admin (Nghia Vo) Admin (Nghia Vo) September 26, 2024
Previous Next
newsletter featured

Always Stay Up to Date

Subscribe to our newsletter to get our newest articles instantly!

Follow US on Social Media

Facebook Youtube Steam Twitch Unity

Copyright © 2024 ohhmua. All rights reserved.

OhhMua

Information

  • About
  • Terms & Conditions
  • Privacy Policy
Welcome Back!

Sign in to your account

Lost your password?