What's your biggest current challenge? Have your say in Community Polls along the right column.
Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Re: Storefront Customer Order history only this calendar year?

Solved

Storefront Customer Order history only this calendar year?

StephenK
Shopify Partner
81 7 46

We've been building a customer storefront and about to launch soon.

Notice during testing today that since we rolled into 2021, that when logged in, customers only see the orders placed in 2021 not the 2020 ones?

Just using a typical `customer()` graphQL query along these lines:-

customer(customerAccessToken: $token) {
id
orders(first: $first, after:$afterCursor, reverse: true) {
pageInfo {
hasNextPage
hasPreviousPage
}
edges {
cursor
node { ...

Anyone else noticed this and know how to grab orders back before 2021?

Some Shopify/Ecommerce related articles - https://medium.com/@stephenkeable
Accepted Solution (1)

c10s
Shopify Partner
67 12 27

This is an accepted solution.

Strange, just tested mine and it's giving me the expected result (orders from 2021 and 2020), test query below:

customer(customerAccessToken: $customerAccessToken) {
  orders(first: 100, reverse: true) {
    edges {
      node {
        id
        orderNumber
        processedAt
      }
    }
  }
}

 Using the xx.myshopify.com/api/2021-01/graphql.json endpoint.

View solution in original post

Replies 2 (2)

c10s
Shopify Partner
67 12 27

This is an accepted solution.

Strange, just tested mine and it's giving me the expected result (orders from 2021 and 2020), test query below:

customer(customerAccessToken: $customerAccessToken) {
  orders(first: 100, reverse: true) {
    edges {
      node {
        id
        orderNumber
        processedAt
      }
    }
  }
}

 Using the xx.myshopify.com/api/2021-01/graphql.json endpoint.

StephenK
Shopify Partner
81 7 46

So turned out to be an unrelated bug in the frontend, that happened to affect the the last order of 2020.

Thanks for reassuring me it wasn't a problem with the backend at least.

Some Shopify/Ecommerce related articles - https://medium.com/@stephenkeable