My private collection code is affecting every single collection.

preluxedaustral
New Member
6 0 0

Huge plea for help, been stuck on this for days! Everything with my code is working okay for the goal of restricting access unless a customer logs in. But the problem with this collection template, is it's affecting every single collection (all collections are restricted unless you log in), so i'm assuming there's a problem with my "else" are anything below that. 

 

I only put the collection template under 1 collection, "revolving market", for my site www.preluxed.com.au, but every collection is affected. please help, for reference my theme is "Taste" and here is my code i added. Thanks everyone!! I just want it to affect the collections i add the template under.

 

Screen Shot 2023-10-15 at 11.41.41 pm.png

Replies 4 (4)
gr_trading
Shopify Partner
1387 130 151

Hi @preluxedaustral 

 

Please exchange the lines.

 

When you write

 

If customer

Content will available to login user only

Else

Content will visible to everyone 

Endif

 

Hope this will help...

For any custom development WhatsApp or connect at Email ID: gr.trading15@gmail.com for quick consultation. | YouTube Videos
To support Buy Me a Coffee
preluxedaustral
New Member
6 0 0

Hi could you please let me know what the replacement coding for the "

Content will available to login user only" and "Content will visible to everyone" as i tried and am beginner not sure how to work it

gr_trading
Shopify Partner
1387 130 151
{% if customer %}
{pages['No.access'].content}
Visible to login customer only
{% else %}
{% section 'main-collection-banner' %}
{% section 'main-collection-product-grid' %}
{% endif %}

 

replace your code with above.

For any custom development WhatsApp or connect at Email ID: gr.trading15@gmail.com for quick consultation. | YouTube Videos
To support Buy Me a Coffee
preluxedaustral
New Member
6 0 0

Thanks for that, i put it in but it still isn't working, and now the page won't show. I think it's so difficult 😞