I’m busy with a wordpress/woocommerce site and I’d like to hide the price of an item when it’s zero on the product category/archive page.
I’ve tried looking on the web and in the php files but couldn’t find where I should add the if statement.
My php knowledge is pretty limited. I was wondering if someone else has experience with this or could help me in the right way
Thanks!
This code works with Woocommerce 3.6.3. Copy into your functions.php
Here’s another approach:
I haven’t tested it but I expect something like this should do the job. Add this to your functions.php file.
This one finally did it for me (using woocommerce 3.0.8):
!is_admin()
Tried Jared’s answer but just as someone stated, it removed every price once the condition was met. Ultimately I went this solution where it removed the action if the price was 0 and added it back if it wasn’t. Seems to work.