Filtering variable WooCommerce products by stock level using meta_query

you are not showing $quantity, maybe that is off? this one here definitely works: $args = [ ‘post_type’ => ‘product_variation’, ‘posts_per_page’ => 100, ‘meta_query’ => [ [ ‘key’ => ‘_stock’, ‘value’ => 0, ‘compare’ => ‘>’, ‘type’ => ‘NUMERIC’ ] ] ]; $query = new WP_Query($args); with this query, you get all variations, that are … Read more