0

Under Drupal Commerce 8.x-2.13 I find that the query

Drupal::entityQuery('commerce_order') 

with no conditions attached returns ONLY incomplete orders (when called in the context of an API endpoint) - and if I apply any parameters exclusive of incomplete orders such as

$query->condition('state', 'completed');

it returns nothing. How can entityQuery be made to retrieve data on completed orders?

New contributor
Quoi is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
1

The solution is apparently to add $query->accessCheck(FALSE);.

New contributor
Quoi is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.

Your Answer

Quoi is a new contributor. Be nice, and check out our Code of Conduct.

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.