Solved

How to display specific products to VIP customers in the Dawn theme?

Groefte
Tourist
8 2 1

Using the Dawn theme.

We have products that must only be shown to certain customers.

 

I have followed this https://yagisoftware.com/articles/only-show-products-to-certain-customers-in-shopify  guide and created 2 new product templates:

1 for products with tags "private" that can only be seen by customers with tags "VIP"

1 for products with tags "private-1" that can only be seen by customers with tags "VIP-1".

Everything here works fine..:)  

Then I have reached the point that the products should not be displayed in Catalog and All by inserting this code in main-collection-product-grid.liquid

 

{% if product.tags contains "private" %}
  {% unless customer.tags contains "VIP" %}
    {% continue %}
  {% endunless %}
{% endif %}

How to also include product.tags contains "private-1" and customer.tags contains "VIP-1" in the code. 

 

Will be very grateful if anyone can help with this..:)

Accepted Solution (1)
Groefte
Tourist
8 2 1

This is an accepted solution.

Yes  -  I am completely new to Shopify and I see that the tagged products (of course) appear in search and featured products, etc. etc. so coding would also have to be done in these files and maintain them when updating Theme to a new version. Thanks a lot for trying to help but I think I'll try to find an App for this.

View solution in original post

Replies 10 (10)

progryss
Shopify Partner
12 0 0

Hi, 

 

To include product.tags contains "private-1" and customer.tags contains "VIP-1" in the code you can use the code below.

 

let me know if this works.

 

{% if product.tags contains "private" or product.tags contains "private-1" %}
{% unless customer.tags contains "VIP" or customer.tags contains "VIP-1" %}
{% continue %}
{% endunless %}
{% endif %}

 

Cheers

Aditya Khanna

Founder & CEO 

Progryss.com

Aditya Khanna | Progryss
e: aditya@progryss.com
Groefte
Tourist
8 2 1

Hi Aditya,

Thanks for your suggestion but sorry it doesn't work. It only works if the customer has none of the tags.

Groefte
Tourist
8 2 1

...forgot to mention that the customer can have tags VIP or VIP-1 or both

progryss
Shopify Partner
12 0 0
{% if product.tags contains "private" %}
  {% unless customer.tags contains "VIP" %}
    {% continue %}
  {% endunless %}
{% endif %}

What happens when you use the above code? Does it work for VIP only?

Aditya Khanna | Progryss
e: aditya@progryss.com
Groefte
Tourist
8 2 1

This is an accepted solution.

Yes  -  I am completely new to Shopify and I see that the tagged products (of course) appear in search and featured products, etc. etc. so coding would also have to be done in these files and maintain them when updating Theme to a new version. Thanks a lot for trying to help but I think I'll try to find an App for this.

progryss
Shopify Partner
12 0 0

We can help code this and make this work without the App. Please connect with me using my email id in the signature.

Aditya Khanna | Progryss
e: aditya@progryss.com
Groefte
Tourist
8 2 1

Thanks Aditya but I found an App

soulchild37
Shopify Partner
166 9 46

Hi Groefte,

Thanks for following the guide! I am the Author of the guide.

For your use case, I think you can use the code below : 

{% if product.tags contains "private" %}
  {% unless customer.tags contains "VIP" %}
    {% continue %}
  {% endunless %}
{% endif %}

{% if product.tags contains "private-1" %}
  {% unless customer.tags contains "VIP-1" %}
    {% continue %}
  {% endunless %}
{% endif %}

 
You can add the private-1 / vip-1 part below the original code you posted, I think this should work.

Hope this helps!

Axel

Spent too much support time dealing with order cancellation request from customer? Wouldn't it be good if customer can cancel order on their own without bugging your support? Try out Cancellable app! https://apps.shopify.com/cancellable . I also write articles about store customization that can improve your customer shopping experience here : Yagi Software Blog
Groefte
Tourist
8 2 1

Thank you very much Alex. I have found an App for this and it works really well but thanks for your suggestion - there may be others who come across this question who can make use of it.

khalid_gh
Shopify Partner
9 0 0

Hi @Groefte

Why not save the hassle and use a third-party app? I'm using AI Search & Product Filter, which is easy to manage via a friendly dashboard

It's possible to achieve your request within a minute using their merchandising rule feature.