All things Shopify and commerce
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..:)
Solved! Go to the solution
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.
Hi Aditya,
Thanks for your suggestion but sorry it doesn't work. It only works if the customer has none of the tags.
...forgot to mention that the customer can have tags VIP or VIP-1 or both
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.
Thanks Aditya but I found an App
Good day,
What app are you using
Ymq B2B Login/Lock Hide Price https://apps.shopify.com/ymq-b2b-login-lock-hide-price?locale=da - it have a feature Hide Products & Collections - here you can set up a lot of rules 🙂
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
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.
This is the solution!!
This along with the very easy to follow guide, even if you aren't using Dawn theme - you can work out where to go easily with such detailed instructions!
Managed to solve my issue in showing Warranty £0 products for Customers only when they are logged in with 'Warranty' tags on their profile
DO NOT PAY FOR APPS THAT COVER (ONE OF MANY) FEATURES SHOPIFY SHOULD HAVE AS STANDARD
As good as Shopify can be, how it misses so many basic and common features - and just puts emphasis on buying apps to make hosting more and more expensive - is frankly criminal!
Luckily there are people out there with the coding knowledge to make it super easy even for noobs like me to sort!
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.
Hey Community! As the holiday season unfolds, we want to extend heartfelt thanks to a...
By JasonH Dec 6, 2024Dropshipping, a high-growth, $226 billion-dollar industry, remains a highly dynamic bus...
By JasonH Nov 27, 2024Hey Community! It’s time to share some appreciation and celebrate what we have accomplis...
By JasonH Nov 14, 2024