Have your say in Community Polls: What was/is your greatest motivation to start your own business?
Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Getting applied metafield-based filter in collection pages when there are no results

Getting applied metafield-based filter in collection pages when there are no results

marcoswata
Shopify Partner
123 10 39

So.. I am able to apply a filter to a collection based on a metafield, as described here.

 

So this URL gives me a few results:

/collections/all?filter.p.m.description.potato=16

And I will see Potato as a filter inside active_values

 

But this URL doesn't give me any results:
/collections/all?filter.p.m.description.potato=666

So Potato is not in active_values

 

I'm trying to display 16 or 666 as an applied filter on the collection page, no matter the amount of results (zero or not).

 

Is there another way of getting the applied filter (that's based on a metafield)?

 

Is there a better way to achieve this?

Thanks!!!

 

If my answer was helpful then please Like and Accept Solution 🙂
If you need help with design, development or marketing your store, contact me!
Replies 0 (0)