Make products only visible for people who are logged in

Hey everyone! I need help with some member products on my website.

I was wondering if anyone had a good solution for members only products in a easy way?

So basically i want if i create a new product, i can sell them to members that are logged in to my shopify page.

So they will get the chance to buy our products first and after i can realease them to everyone. So only people who are logged in can see the product i choose.

Is there any good or easy solution for this? I was wondering if you could hide them with tags or something like that.

My page: https://americanwine.dk/

Thanks!

Hi @LauraOO , sure you can do this :slightly_smiling_face:
Here is an example if those customers have tag ‘member’.
So you only need to add this condition wherever you are showing products:

{% if customer.tags contains "member" %}
//YOUR PRODUCTS CODE
{% else %}
## In order to see our products, you need to be logged in.
{%endif%}

If you are not comfortable in writing some code, there is always an app like locksmith that can help you with hiding pages.

Hey @MarinaPetrovic , thanks for the reply!

Would you mind make the code more specific?

What could should i insert at // Your product code?

And also when this code is inserted i could tag a product with member and it would hide for non members correct?

Also should it be placed in theme.liquid?

1 Like

where would this be added this looks like php coding so where exactly would you find where to put this?

1 Like

i just did {% if customer %} around the collection

which worked for me. However i think since its in a theme customizer, it applies to every page with that component. In my case, im ok with that but i’m not sure everyone will be. Maybe creating custom liquid components would help with this but i havent tried that.