I have WooCommerce variable products and a filter which is filtering products based on variation attributes. I have variation attribute depth which has numeric value (from 1 to 20) and the filter is working fine. But I want to display In Stock variations only On the other hand it is displaying all products including out of stock selected depth value (variation). So I want to hide product which will have selected depth value but no stock.
Can I query through Products variation stock ?