Shopify themes, liquid, logos, and UX
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?
Can you share how you resolved this? I am having same issue.
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.
Hello,
Wondering how you resolved this. I am experiencing the same issue. If you could please share that would be great.
Thanks!
All solved.
had to change the commas.
Hi,
I'm trying to set up this exact same code. How did you solve it? Where are the commas that you changed?
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?
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!
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 %}
Are you ready to take your business to the next level? Look no further than the latest ...
By SarahF_Shopify Apr 15, 2024We’re keeping the ball rolling to make sure you’re always ahead of the game. So buckle ...
By JasonH Apr 8, 2024Portrait of Stephen positioned next to an image of planet Earth, with the Stephen's World ...
By JasonH Mar 18, 2024