In this video, you will learn how to add password protected colletion for Special Customers, Whole Sale Customers etc.
Having a password protected collection page can be useful if you want to limit access to certain products or collections to specific customers or groups.
Creating a password protected collection for special customers may lead to an increase in sales for your store. By offering exclusive access to certain products or collections, you can create a sense of exclusivity and urgency among those special customers, which may prompt them to make a purchase. Additionally, by limiting access to certain products, you may be able to charge a premium price for them.
Add the following code to the collection template file:
{% if customer.tags contains "private" %}
{% section 'main-collection-product-grid' %}
{% else %}
<div class="page-width style_private">
<h2>Please login to view this collection</h2>
<a href="{{ routes.account_login_url }}">Login</a>
<!-- <a href="{{ routes.account_register_url }}">Register</a> -->
</div>
{% endif %}
Add the following code in base.css file
.style_private{
text-align: center;
}
.style_private a{
text-decoration: none;
padding: 8px 15px;
border-radius: 5px;
background: #efefef;
margin: 0 5px;
}
5/5 - (9 votes)
9 thoughts on “How To Add Password Protected Collection For Special Customers – Shopify”
Hi, I have version Debut version 17.10.0 and i cant find base.css ! Normal? Thanks !
You can add code to any CSS file
hi
first, let me say thank you for your videos.
I have a quick note; the password won’t help if someone has a direct link to the product I believe we will have to password-protect the product page too. Do you have a quick fix for that?
Yes you can add password protection on your liquid code as well
Good morning! thanks for the tutorial!
If I want to have a separate collection per client, do I have to create 1 template for each or I can do otherwise
thanks again
Thank you for a great tutorial. Is there a way to add a text box specific only to this private collection page? As it is a liquid collection I do not see any way when customizing to add a text box without it appearing on all collection pages. Thanks!
Sure, please email us with your store details and screen recording.
I am getting error like – Liquid error (templates/collection.private line 2): Error in tag ‘section’ – ‘main-collection-product-grid’ is not a valid section type
Looks like not properly implemented