All things Shopify and commerce
I have a bunch of products in a password protected private collection. Here is the code for the collection:
{{ product.price | money }}
{% if customer.tags contins '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 %}
<style>
.style_private{
text-align: center;
margin-top: 80px;
margin-bottom: 80px;
}
.style_private a{
text-decoration: none;
padding: 8px 15px;
border-radius: 5px;
background: #efefef;
margin: 0 5px;
}
</style>
Use the following code
{%- for product in collection.products -%}
{{ product.price | money }}
{%- endfor -%}
done
Learn how to build powerful custom workflows in Shopify Flow with expert guidance from ...
By Jacqui May 7, 2025Did You Know? May is named after Maia, the Roman goddess of growth and flourishing! ...
By JasonH May 2, 2025Discover opportunities to improve SEO with new guidance available from Shopify’s growth...
By Jacqui May 1, 2025