question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Get List of All Order

See original GitHub issue

Hi, I need some help in getting all orders. I am using following code and trying to get all orders.

` public class OrderController { private OrderService service = null;

    public OrderController(string shopURL, string shopAccessToken)
    {
        service = new OrderService(shopURL, shopAccessToken);
    }
    public List<Order> GetAllOrders()
    {
        List<Order> allOrders = new List<Order>();


        var all_orders = service.ListAsync().Result; //return only 1


        //following code also return only 1
        ListResult<Order> batch = service.ListAsync(new ListFilter<Order>("", 250)).Result;
        while (true)
        {
            allOrders.AddRange(batch.Items);
            if (!batch.HasNextPage)
            {
                break;
            }
            batch = service.ListAsync(batch.GetNextPageFilter()).Result;
        }
        return allOrders;
    }
}

`

but it returns only unfulfilled orders. I need list of all order does not matter what the status is

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
shafaqat309commented, Aug 14, 2021

Got it

this worked

var of = new OrderListFilter() { Status = “any”, Limit = 250 }; ListResult<Order> batch = service.ListAsync(of).Result;

0reactions
xplertorcommented, Nov 16, 2021

Filter status doesn’t work and in an item, the variable doesn’t find a status variable. (I try found orders open and paid for insert in another system)

Read more comments on GitHub >

github_iconTop Results From Across the Web

SQL query to bring back all orders only if ...
SQL query to bring back all orders only if all order details are in a list ; SELECT · FROM · IN ·...
Read more >
Lists in All Orders
Click this icon to open the Item List. You can also get to all the lists from the List menu. In All Orders...
Read more >
Select all orders which have the same order items
I need to fetch all orders which have the same cart (same list of order items and quantity). Here are my tables: orders...
Read more >
Is there a way to get a list with all the items and their ...
Is there a way to get a list with all the items and their quantities for all all open orders via either the...
Read more >
Solved: Help to find and list all Order ID's from users wh...
What I wish to achieve is to find and list all Order ID's from users who have placed more than 2 orders in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found