Woocommerce - Hide Price in Specific Category

  • You MUST read the Babiato Rules before making your first post otherwise you may get permanent warning points or a permanent Ban.

  • Our resources on Babiato Forum are CLEAN and SAFE. So you can use them for development and testing purposes. If your are on Windows and have an antivirus that alerts you about a possible infection: Know it's a false positive because all scripts are double checked by our experts. We advise you to add Babiato to trusted sites/sources or disable your antivirus momentarily while downloading a resource. "Enjoy your presence on Babiato"

xlx

Member
Dec 13, 2018
78
22
8
Hello,

I have a ecommerce cart, built on woocommerce.
I need to hide the price in the category page for specific categories.
But the price should be displayed in the individual product page

Ive used this piece of code

PHP:
You don't have permission to view the code content. Log in or register now.
following this article

The only issue being it hides the price for all categories, not specific ones
for example i want to hide headphones and covers.

Can someone please edit the code to hide only specific categories.

Thanks for helping
 
Last edited:

slvrsteele

- Recovering! Available soon -
Staff member
Moderator
Null Master
Trusted Uploader
Nov 5, 2019
2,149
1,913
113
CDN
You should add a filter like:

Code:
You don't have permission to view the code content. Log in or register now.
Add this code to your theme or child theme function.php
 
  • Like
Reactions: xlx

xlx

Member
Dec 13, 2018
78
22
8
@slvrsteele Thanks for your awesome help.

This code does work on the shop page, and it does not show the price in the selected category.
But it also hides the price once i click the product, i do want to show the price when the user clicks on the individual product.

Thanks again for helping
 

slvrsteele

- Recovering! Available soon -
Staff member
Moderator
Null Master
Trusted Uploader
Nov 5, 2019
2,149
1,913
113
CDN
Last edited:
  • Like
Reactions: xlx

xlx

Member
Dec 13, 2018
78
22
8
@slvrsteele This works fantastic. thanks for helping bro,

Now i realize i failed to share a vital piece of information, the above code works flawlessly on my shop page. I have made a separate page for sale and have used wpbakery to pull products from my special categories on this page.

Can the same functionality be added to this specific page?
Really appreciate for your patience.