How can I add vendor-based sorting on my site?

I’m just wondering if there is any way to add a new category to the ‘sort by’ on my site. It only lets me sort alphabetically by the product, and I really need it to sort alphabetically by the vendor’s name.

1 Like

This is possible but complicated. You can use the following code below to sort but to include this in your ‘sort by’ is complicated. You will need a developer to do so. You can message me to provide you a quote. Please include your theme

{% assign product_vendors = collection.products | sort: "vendor"  %}

Thanks. So I don’t want to include it in the ‘sort by’, I want it to be sorted by vendor alphabetically instead of the product name - so happy for the alphabetical sort to remain, just with a different function.

Also, where would I insert the code you’ve listed above? Thanks

Could you quote me for my site? I am about to use Baseline and would love to be able to search a - z