Hide and show collection with customer tag

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

1 Like

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 %}

Hi Zaczee,

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

  • 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!