Restrict a collecti...
 
Notifications
Clear all

[Solved] Restrict a collection to logged in user in Shopify

3 Posts
2 Users
1 Reactions
2,819 Views
Bill-next-gate
(@bill-next-gate)
Active Member
Joined: 4 years ago
Posts: 17
Topic starter  

Hi,

I have a collection named (Best Selling) that I would like to show a different template ( i already have the code for it) for logged in users only, the non logged will see the standard best selling collection.

I hired someone from fiverr but he fails to achieve it, so I ma writting to you as you know better your Plak theme.

Thanks in advance


   
Quote
Jasmine Keinsh
(@plakadmin)
Estimable Member Admin
Joined: 4 years ago
Posts: 131
 

Hi @bill-next-gate

Jasmine from Plak support here,

First of all, in order to avoid hassles with external third party developers, I invite you to always use our forum support for help with anything regarding your Shopify store, otherwise, if you are not a tech savy, you can use our paid CUSTOM TASK SERVICE

Regarding your question, please follow these steps to restrict the access to your custom collection for logged users only.

  • From your Shopify admin, click Online store > Actions > Edit code 
  • Under template, open the file collection.liquid
  • Locate the code
{% section 'collection-template' %}
  • Wrap it with a condition, so your code becomes
{% if collection.title == 'Best Selling' and customer %}
<div> Your custom code for logged users here </div>
{% else %}
{% section 'collection-template' %}
{% endif %}
  • Click Save 

 

Note that the collection name on this code must be exactly the one you assigned to your collection, and it is case sensitive 😉

I hope this may help.

Kind regards,
Jasmine

Jasmine | Plak theme support
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as a Solved Solution


   
ReplyQuote
Bill-next-gate
(@bill-next-gate)
Active Member
Joined: 4 years ago
Posts: 17
Topic starter  

It worked great ! thank you so much


   
ReplyQuote
Share:

Welcome to the Shopify Forum Community provided by Plak ThemeLLC, a place where you can discuss about eCommerce and Shopify, solve technical issues, get help with Shopify Design, Apps integration, Marketing, Facebooks ad, Google ads and more.

Before posting, we invite you to read and follow the forum rules | We also support any questions related to Free Shopify themes :Dawn, Express, Minimal, Brooklyn, Narrative, Supply, Debut, Venture, Boundless and Simple