- Issue created by @adelgado12
- 🇫🇷France flocondetoile Lyon
Hello. Better to do this at the query level no ?
In the commerce_cart.cron service
protected function getOrderIds($order_type_id, Interval $interval) { $current_date = new DrupalDateTime('now'); $expiration_date = $interval->subtract($current_date); $ids = $this->orderStorage->getQuery() ->condition('type', $order_type_id) ->condition('changed', $expiration_date->getTimestamp(), '<=') ->condition('cart', TRUE) ->range(0, 250) ->accessCheck(FALSE) ->addTag('commerce_cart_expiration') ->execute(); return $ids; }
- 🇫🇷France flocondetoile Lyon
But you need to check the status (as you do in your patch) too juste before deleting it. An order can be locked after being added in the queue expiration