Category: <span>Customisation</span>

Mini plugin: Disable WooCommerce prices and add to cart for visitors

This is a mini plugin that lets you hide WooCommerce prices
and the add to cart button for non logged in visitors of your site.

Install and activate to hide the elements site-wide.
Screenshots
Shop overview:

 

https://cloudup.com/cEwUMPVsK2m

Single Product page:

https://cloudup.com/cXcQKk_fXY2

 
Download
Download Disable WooCommerce prices and add to cart for visitors plugin

 

Tested with:
WordPress 4.8.2
WooCommerce 3.2.1

How to find the right CSS class to edit to apply custom CSS in WordPress

There are many plugins for WordPress that allow you to apply custom CSS. Most theme have their dedicated sections. However how do you know which class you need to modify?

Use Google Chrome development tools to inspect

I use Google Chrome development tools for this. Here is a quick screencast that shows how to find the right class and edit / apply custom CSS:

Here is what I do step by step

The tab titles “Description” and “Reviews” are crammed into the left corner.

How to change ‘select options’ ‘add to cart’ button text in WooCommerce

You can use a filter to change the ‘select options’ button text in WooCommerce like so:

If you are unsure on what to do with this, read this first: How to use custom code snippets.

If I find the time I will turn this into a mini plugin for convenient use. Let me know in the comments, if you would have need of this.

This code snippet taps into the “Add to Cart” button for WooCommerce core so it can also be used to modify it.

For WooCommerce Subscriptions this is not necessary.