I'm using new WC_Product_Query to get products for a stock report but so far I'm only able to set In-stock or Out-of-Stock in the query.
How do I go about setting the query to get all products regardless of stock status or set it to just grab In-stock and Out-of-Stock products as we don't use backorders?
$query = new WC_Product_Query( array(
'orderby' => 'title',
'order' => 'ASC',
'return' => 'ids',
'category' => $club_cat,
'limit' => -1,
) );
Its probably worth mentioning that if i use 'stock_status' => 'outofstock',
I don't get any products returned and 'stock_status' => 'instock',
only returns products that are in stock.
I'm not sure if it's relevant to this but we use a mix of simple and variable products some are stock managed at the product level and others stock managed at the variation level.
Thanks for reading :)