How can I hide prices on my wholesale store unless customers are logged in?

Hi,

I have been developing a 2nd shopify store for quite sometime, hoping to launch my second business soon.

My new business is a wholesale company and I wanted to be able to hide the prices and the add the cart button unless you are logged in. Since I haven’t visited my development site for quite sometime, I thought I would update my theme to a OS 2.0 theme and I have chosen to use ‘Dawn’

I was previously using the ‘Minimal’ theme.

Anyway, I used the following post:

https://community.shopify.com/topic/471464

to achieve my task of hiding the prices and the ‘Add to Cart’ button unless logged in to the store but now I can’t figure out how to do this for the new OS 2.0 theme? Can anyone advise?

I have noticed that I will also have to hide the prices from the collection page too as they are showing up on there.

Thanks in advance.

I have used the following to hide the prices from the collection pages:

https://community.shopify.com/topic/1338562

This is whether the customer is logged in or not, but thats fine for me at present. I may wish to change this in the future though.

@Sewing-Geek

You are going to want to add something like this:

{% if customer %}
Code for price and/or button
{% endif %}

Where you add the conditional checking for if there is a logged in customer around any code you do not want to render unless the customer is logged in. You could switch that to use “unless” and “endunless” if you wanted to have something display to only guest customers.

Depending on your business model, and assuming it is within the AUP, you could use a subscriptions app like PayWhirl to add a wholesale membership subscription product so that when customers buy it they can be tagged as a subscribing member and then you can have that code example above modified to also look for the tag so that only subscribing members can view the price and add to cart buttons. Granted it’s not 100% preventative but for normal customers it would be a solution that works.

Hope that helps!