! I'm trying to get all the fulfilled orders, for that I created this function:
public function getOrders($status = null, $financialStatus = null, $since = null, $limit = 250)
{
$shopify = $this->connectToShopify();
if ($shopify) {
$options['limit'] = $limit;
if ($status !== null) {
$options['status'] = $status;
}
if ($financialStatus !== null) {
$options['financial_status'] = $financialStatus;
}
if ($since !== null) {
$options['since_id'] = $since;
}
return $shopify->Order->get($options);
} else {
return [];
}
}
If I pass 'closed' to the status variable, it retrieves both canceled and fulfilled orders, but I need only the shipped orders. For that, I created this second function:
public function getFulfilledOrders($status, $since = null, $limit = 250)
{
$shopify = $this->connectToShopify();
if ($shopify) {
if ($status !== null) {
$options['fulfillment_status'] = 'fulfilled';
}
return $shopify->Order->get($options);
} else {
return [];
}
}
However, this function returns an empty array
Array ()
despite having more than 1000. What could be my mistake? Thank you!
! I'm trying to get all the fulfilled orders, for that I created this function:
If I pass 'closed' to the status variable, it retrieves both canceled and fulfilled orders, but I need only the shipped orders. For that, I created this second function:
However, this function returns an empty array
Array ()despite having more than 1000. What could be my mistake? Thank you!