Hide “Add to cart” Button When Product Price is Zero

Prem Tiwari - - WordPress, WordPress Snippets

Hi friends, Yesterday I got the tutorial request from my blog reader about WooCommerce code hacks to hide Add to cart button when the product price is zero.

For the better understanding here is the complete question “How to hide “Add to cart” button when the product price is Zero”.


Open functions.php file from current activated theme folder and add the bellow code at the end of the file and save it. It will automatically hide the Add to Cart button for all products which price is zero or not entered during product creation time.

Over to You

Do you like & share this article with your friends, and don’t forget to follow us on Facebook and Twitter to learn cool WordPress tutorials.

About: Prem Tiwari

Prem Tiwari is the founder of FreeWebMentor.com and also a professional developer who has vast experience in PHP and open source technologies. Apart from this, he is a blogger by hobby and also he has been a regular speaker of WordPress sessions in various IT Companies.

Tags: , , , , , , , ,