hiding add to cart for non log in customer

New Member
1 0 0

Hi all,


Sorry if this have been answered before but I cant find it.

I managed to hide pricing for non log in customer but if they add item to card they can still see the pricing.

So what I want to do is hide the "add to cart" button for non log in customer so they cant see the pricing in the card.

Please help, thanks.

Shopify Expert
2505 420 529

Hi @biolase 

If you want to hide add to cart button form product page then you have to follow this:

1. Go to Section->product-template.liquid file and find name="add" (that's your add to cart button) now add condition like this:

{% if customer %}
 //Add your existing add to cart code here
{% endif %}

So now add to cart button only show if user login. If you want to do on collection page then you have to do same in Snippet->product-grid.liquid or Snippet->product-cart.liquid

Want to modify or custom changes on store hire me.
If helpful then please Like and Accept Solution.
Email: jasoliyabrijesh123@gmail.com
Skype: jasoliya.brijesh
Want to get Free review and advice for sale on store ?? just text me here