Hi everyone,
Don’t know if you can help. I am trying to create a collection where only my subscribed members can view. I don’t want to download an app as they are paid. I have found this code:
{% if customer.tags contains ‘vip’ %}
{% section ‘collection’ %}
{% else %}
{{ pages.no-access.content }}
{% endif %}
but I keep getting this error when saving:
Liquid syntax error: Error in tag ‘section’ - Valid syntax: section ‘[type]’
Any ideas on how to fix this, I’m not a coder, so please be gentle on me
Josh
Ignore the above, I have figured this out now. However, my tagged customers still cant view the page. Any ideas?
All solved.
had to change the commas.
Hey there,
Do you have collection.liquid in your sections folder ?
If not exists then please create new one OR check what section liquid file you would like to display with and name correct there.
Thanks!
system
August 26, 2020, 5:52pm
5
Hi,
I’m trying to set up this exact same code. How did you solve it? Where are the commas that you changed?
L9OBL
October 12, 2020, 9:48pm
6
It wasnt commas, he’s talking about the apostrophe’s used in the code, you can see theyre kind of stylized, just replace them with regular apostrophes on the first and second line.
so I am using this same code, it was working fine. i.e. showing the no access page to those without tags, only showing product for those with tags.
But now for some reason it is showing both the no access page and the product to anyone with the collection page link.
ANY ideas?
gwenp
September 15, 2021, 2:21am
8
Can you share how you resolved this? I am having same issue.
okioki
January 7, 2022, 11:10am
9
Hi Gwenp,
not sure if this is still relevant, but I had the same issue. For me it was a matter of swapping out the quotation marks from the code I had pasted in.
Show More
Hello,
Wondering how you resolved this. I am experiencing the same issue. If you could please share that would be great.
Thanks!
Apologies, I had someone edit the code on my store as I couldn’t find the solution.
emex
June 10, 2023, 12:47am
12
Was having same issue.
if you replace the code with this it will fix it:
{% if customer.tags contains ‘vip’ %}
{% section ‘collection’ %}
{% else %}
{{ pages[‘no-access’].content }}
{% endif %}