This is a fashion website. We sell products designed by various designers. We wish our visitors to select a designer to view their products.
For this we have created a link called “Shop by Designers” in our navigational menu AND added vendor names while adding products.
What do we need to do so that Shop by Designers is populated by vendor names and stays updated as new vendors are added.
We would also like to have a page where all the vendors are listed, linked to their individual page or their collection.
Hope my question is clear. Please feel free to touch base with me in case of any clarifications or queries.
Regards,
1 Like
I think the option you have is iterating through all products and collecting the vendors using liquid. But this significantly slows down your store since your backend has to check each product data whenever a page on your website it opened. I think it is better to add the vendor list manually - it will be hardcoded and makes your website faster. Here is the liquid code for the former option:
{% assign vendors = '' %}
{% for product in collections.all.products %}
{% unless vendors contains product.vendor %}
{{ product.vendor }}
{% capture vendors %}{{ vendors }} {{ product.vendor }}{% endcapture %}
{% endunless %}
{% endfor %}
Hi @YOD_Solutions ,
Thank you for guiding me. As per your suggestion we are moving ahead with manual entry and have implemented your solution on our website.
Regards,
Sudeep