Create a private collection

Hello,

I want to create a private collection on my store, so only people with an account can access the collection. I also want to mask the private collection article everywhere on the website. So it just can be accessible in the private collection menu.

I use dawn theme, this is my website: womber.fr and the password is PROPAGANDAAA

Thanks,

Cordially,

1 Like

To achieve function you need assign for each user a tag, then when user login you can check if user has the tag will show the collection if the user has not tag or not login the collection will hide.

What is the code to add in what files to made this happens, because I added the tag but it’s not working…

You need to check in code at the file handling show menu.

{% assign statusShow = false %}
{% for tag in customer.tags %}
  {% if tag contains 'abc' %}
     {% assign statusShow = true %}
  {% endif %}
{% endfor %}

Then you can check if statuShow == true => make the collection show and opposite hide that collection

{% if collection.handle == 'womber-x-spicyv' %}
    {% if customer == null %}
      
    {% endif %}
  {% endif %}
  • Here is the solution for you @PAUL8
  • Please follow these steps:
  1. Go to Online Store → Theme → Edit code.
  2. Open your theme.liquid file
  3. In theme.liquid, paste the below code before and press ‘Save’ to save it
{% if collection.handle == 'womber-x-spicyv' %}
    {% if customer == null %}
      
    {% endif %}
  {% endif %}
  • change womber-x-spicyv to collection you want make private

  • Please press ‘Like’ and mark it as ‘Solution’ if you find it helpful. Thank you.

Hello,
It’s not working…

1 Like

Can you send me the link of the collection you want to make private, I will send you the code again.