Hide and show collection with customer tag

Jòóst
Excursionist
23 1 6

Hey Tech brains,

 

Would it be possible to hide a B2C collection and show only a B2B collection with a customer B2B tag?

 

Thanks, Joost

Replies 3 (3)

zaczee
Globetrotter
848 46 42

Hi,

 

You can try this code to hide and show collection based on customer tag

{% if customer.tags contains 'customer tag' and collection.title == 'collection title' %}
{% endif %}

 

Jòóst
Excursionist
23 1 6

Hi Zaczee, 

 

Thanks! Can you tell where to place this code, please?

Jòóst
Excursionist
23 1 6

 

  • I like to show my collection 'B2B Shop' to customers with the tag 'b2b-Klant' only
  • and hide my collection 'B2C Shop' for customers with tag 'b2b-Klant'

Can anyone create this code and tell me where to place this, please?

 

Looking forward to your replay!