/** * Moves old orders to "On Hold" status. * * @internal */ public function updatePendingOrders() { if ($this->options->get('advanced.automatic_reset')) { $orders = $this->orderService->findOldPending(); foreach ($orders as $order) { $this->emailService->suppressNextEmail(); /** @var $order \Jigoshop\Entity\Order */ $order->setStatus(Status::ON_HOLD, __('Archived due to order being in pending state for a month or longer.', 'jigoshop')); $this->orderService->save($order); } } }
/** * @return array List of orders that are too long in Pending status. */ public function findOldPending() { return $this->service->findOldPending(); }