Storefront collection filtering using product metafields

I’ve got storefront filtering working using attributes like product_type and tags.

I wanted to add a metafield based attribute, but I can’t see any way to define a new filter based on metafields in the new Shopify Search and Discovery app.

I would expect metafields to be listed as a filter source option.

I’ve created a product metafield (single line text) as a test with namespace=filter, key=colour and value=orange

and I expected to be able to filter this with the url parameter

&filter.p.m.filter.colour=orange

But this doesn’t seem to work.

Any ideas what I’m doing wrong here, or how I should define the metafield based filters?

Thanks

I figured out that the missing step was to “Define” the metafield.

This option has been renamed recently so it’s now in the Settings menu area under “Custom data”.

Don’t forget to check the option to make the definition available to Storefront.

1 Like