View products with all out of stock variants

Hi,

on my “Craft” theme I need to change the product filter logic. When the “Availability” filter is selected on “Out of stock” I would like to display only products that have all the variants out of stock. Now if I have the “Out of stock” filter active, if a product has 3 variants and only one out of stock, the product comes out in the display.
How could this be solved?

Thank you

Hi @Mario_Caputo

In case you use Search & Discovery, and not some third party app filter, this is not supported out of the box via the Availability filter (?filter.v.availability=1).

I think the best solution would be to have a product metafield (True/false) that tracks if all variants are in stock or not. Then you can create a custom filter (just name it Availability) based off this value instead.

Should be able to create something that keeps track of this with Shopify Flow.

1 Like

@curzey is correct, availability is based on variant availability only
The suggestion to use a metafield should work and should achieve the initial objective.

1 Like

Hi @curzey e @Arthur_Demurger,

thanks for the support. I will try this solution

Thank you