When use paginate parameter I cant get for example id of orders with get_id().
$args = array(
'limit' => 100,
'paged' => 1,
'status' => array('wc-completed'),
'type'=> 'shop_order'
'paginate' => true,
);
$products = wc_get_orders($args);
foreach($prdocuts as $product){
echo $product->get_id() . '<br>';
}
it returns Fatal error where I use get_id(), "Fatal error: Uncaught Error: Call to a member function get_id() on array in..."
I want to use $products->total
to get total number of orders.
How can I use paginate in query?