Hide Price & Cart Buttons for All Users

Where business professionals discuss big database and data management.
Post Reply
zihadhasan012
Posts: 74
Joined: Thu Dec 26, 2024 5:23 am

Hide Price & Cart Buttons for All Users

Post by zihadhasan012 »

If you want to hide prices and cart buttons for everyone who visits your WooCommerce store, you'll need to add a different code snippet. This method works whether users are logged in or not.

Start by going to Code Snippets » + Add Snippet in your WordPress dashboard. Click on 'Add Your Custom Code (New Snippet)' and then the '+Add Custom Snippet' button.

Add Custom Snippet button in WPCode
After that, you will see some code types to choose from.

Here, just choose 'PHP Snippet.'

Choosing PHP snippet in WPCode
Next, you need to give your code snippet a title. It mint database can be something simple like 'Hide All WooCommerce Prices.'This code will remove all prices and cart buttons from your store and replace them with a 'Contact us for pricing' link that takes visitors to your contact page .

After pasting the code, switch the toggle from 'Inactive' to 'Active' and click 'Save Snippet.'

Creating a custom code to hide WooCommerce prices for all users in WPCode
And that's it!

You can now visit your store to see that all prices and cart buttons have been replaced with a link to your contact page.
Post Reply