How to hide a product in colleciton page by the customer tag

How to hide a product in colleciton page by the customer tag

John-CC
Shopify Partner
15 0 4

we have a business rule that to avoid customer (with certain customer tag) to view specified prodcut in our store.

 

but when we try to hide with below liquid in our collection page : 

 

{% for product in collection.products %}  {% unless product.tags contains 'your-tag' %}
    <!-- Product HTML here -->
  {% endunless %}
{% endfor %}

There will be problems with paginated display 

 

May i know is there any good practice to implement?

Reply 1 (1)
John-CC
Shopify Partner
15 0 4

but as you known , we seems cannot have a dynamic collection by the customer tag .