How can I make entityQuery('commerce_order') return completed orders?

by Quoi   Last Updated August 14, 2019 06:07 AM

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?



Answers 1


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

Quoi
Quoi
August 14, 2019 05:52 AM

Related Questions


Updated May 14, 2015 15:03 PM

Updated May 30, 2016 08:03 AM

Updated March 24, 2017 20:07 PM

Updated August 08, 2015 14:03 PM

Updated April 03, 2016 08:03 AM