Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get fulfilled orders #316

Open
kahmra opened this issue Jan 11, 2024 · 4 comments
Open

Get fulfilled orders #316

kahmra opened this issue Jan 11, 2024 · 4 comments

Comments

@kahmra
Copy link

kahmra commented Jan 11, 2024

! 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!

@aogg2023
Copy link

I have reviewed your question and have not used it before. I am currently unable to answer you,

Do you know the answer to my question?

How to obtain all orders for a store with over 250 orders? Currently, I can only obtain 250 orders

@kahmra
Copy link
Author

kahmra commented Jan 12, 2024

Currently

$fulfilledOrders = $ShopifyConnection->fulfilledOrders($sinceId,250);
			foreach ($fulfilledOrders as $order) {
				$shopifyBatchProcessData->batchProcess("Orders",$order,"order");
			}

@aogg2023
Copy link

现在

$fulfilledOrders = $ShopifyConnection->fulfilledOrders($sinceId,250);
			foreach ($fulfilledOrders as $order) {
				$shopifyBatchProcessData->batchProcess("Orders",$order,"order");
			}

Thank you.

@aogg2023
Copy link

@kahmra Do you know how to obtain the required parameters for the next page page_info The value of info?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants