Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
I've been using this guide (How to create a private collection for tagged customers – Sunbowl (sunbowlsystems.com) ) to set up a private collection available only to customers who are logged in and tagged 'laybuy' in my online store.
I've used the following code:
{% if customer.tags contains ‘laybuy’ %}
{% section 'collection.laybuys' %}
{% else %}
{{ pages.no-access.content }}
{% endif %}
I'm now at the testing stage, and I can't access the private collection. I think there may be an issue with the second line of coding.
Can someone please advise?
Shelley
The issue in your code seems to be with the quotation marks around the tag name 'laybuy'. In the code you provided, you're using a different type of quotation marks (smart quotes) instead of regular single quotes.
To fix the issue, replace the smart quotes with regular single quotes. Here's the corrected code:
{% if customer.tags contains 'laybuy' %}
{% section 'collection.laybuys' %}
{% else %}
{{ pages.no-access.content }}
{% endif %}
Thanks, but no, that didn't work. I'm getting this error message on the live website now:
Liquid error (templates/collection.laybuys line 2): Error in tag 'section' - 'collection.laybuys' is not a valid section type
Shopify and our financial partners regularly review and update verification requiremen...
By Jacqui Mar 14, 2025Unlock the potential of marketing on your business growth with Shopify Academy's late...
By Shopify Mar 12, 2025Learn how to increase conversion rates in every stage of the customer journey by enroll...
By Shopify Mar 5, 2025