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

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!!!

1 Like