How can I filter both product metafields and variant metafields together?

How can I filter both product metafields and variant metafields together?

TaylorWong
Excursionist
16 0 6

Hi there,

 

I'm trying to do the filtering and I'm stuck.

 

For example, there is a Red-only cup(product with no variant) and a T-shirt with available in several colours which Red is an option(product with variants). To my understanding I would have to add product metafield to the cup so that it could be filtered by its colour, while I can add filter the T-shirt by its variants or through adding variant metafields. However, It seems I cannot add one single filter to filter both product metafields and variant metafields(that means I would have to show two "Colour" filters on the page).

 

I know I can simply add a variant to the cup to show its colour, but it might look a bit strange if I use variant when there is no other options. Though I would make it my last resort, is there anyway I can use only one "Colour" filter them together?

 

Thank you.

Replies 0 (0)