Thanx. This works exactly like my solution. It displays all the products in the shop from the vendor, not the products from this vendor in this specific collection. And I need a « display all » button too.
OK, so I kind of misread your request there (in my defense, it was rather late). Let’s dive into it then:
In order to figure out the unique vendors that exist in a single collection, but not throughout the whole store, you’d need to loop through your collection’s products and loop through each one’s vendor. If we create an array where we can append each unique instance, then we can loop through that array and create a URL with a query string for each one. Kind of like this:
Now, for the Display All option, I imagine that you can just add a link to the collection URL (that last li above).
I have a vague feeling that there’s an easier/more efficient way to do this (since you’d are effectively looping a collection’s products twice), but my brain isn’t working at full capacity at the moment tbh. If I come up with a better option, I’ll let you know.
The above should produce a URL with a query string which filters products for a specific vendor in that specific collection. Each URL should look something like this: