From 190047478d635d7dea0e942099d2cb7aa84f8428 Mon Sep 17 00:00:00 2001 From: Vitalij Mik Date: Tue, 16 Jan 2024 11:21:25 +0100 Subject: [PATCH] MOL-1196: fix automatic shipping and add error logs (#685) * MOL-1196: fix automatic shipping and add error logs * MOL-1196: remove comment --------- Co-authored-by: Vitalij Mik --- src/Service/OrderDeliveryService.php | 1 + src/Subscriber/OrderDeliverySubscriber.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Service/OrderDeliveryService.php b/src/Service/OrderDeliveryService.php index fb3eaad9e..fe74691f8 100644 --- a/src/Service/OrderDeliveryService.php +++ b/src/Service/OrderDeliveryService.php @@ -27,6 +27,7 @@ public function getDelivery(string $orderDeliveryId, Context $context): ?OrderDe { $criteria = new Criteria([$orderDeliveryId]); $criteria->addAssociation('order.transactions.paymentMethod'); + $criteria->addAssociation('order.deliveries'); $criteria->addAssociation('shippingMethod'); $result = $this->orderDeliveryRepository->search($criteria, $context); diff --git a/src/Subscriber/OrderDeliverySubscriber.php b/src/Subscriber/OrderDeliverySubscriber.php index f03bfde78..a6a15a88f 100644 --- a/src/Subscriber/OrderDeliverySubscriber.php +++ b/src/Subscriber/OrderDeliverySubscriber.php @@ -120,7 +120,7 @@ public function onOrderDeliveryChanged(StateMachineStateChangeEvent $event): voi $this->mollieShipment->shipOrderRest($order, null, $event->getContext()); } catch (\Throwable $ex) { - # do nothing in error in subscriber + $this->logger->error('Failed to transfer delivery state to mollie: '.$ex->getMessage()); return; } }