0
我需要按某些sku項目過濾訂單。這裏是我的代碼,其中IM過濾的狀態:如何按項目sku按順序過濾woocommerce api?
$params = array('status' => 'processing');
return $wc_api->get_orders($params);
有回報的響應:
stdClass Object
(
[orders] => Array
(
[0] => stdClass Object
(
[id] => 30
[order_number] => 30
[status] => processing
[line_items] => Array
(
[0] => stdClass Object
(
[id] => 1
[subtotal] => 40.00
[subtotal_tax] => 0.00
[total] => 40.00
[total_tax] => 0.00
[price] => 40.00
[quantity] => 1
[tax_class] =>
[name] => automobilis1
[product_id] => 4
[sku] => sku111111
[meta] => Array
(
)
)
)
)
)
有DOC: https://github.com/kloon/WooCommerce-REST-API-Client-Library
如何篩選爲了在那裏的項目有SKU前。 123?
感謝它爲我工作:) – Haroldas