From e8af207cd63deca00dbd5667e6900c148fcd161f Mon Sep 17 00:00:00 2001 From: Anatol Alfer Date: Fri, 7 Jun 2024 11:30:54 +0300 Subject: [PATCH] POSTNL-149 - Latest magento support as it changes orderId to order --- Plugin/Shipment/ShippingBuilder.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Plugin/Shipment/ShippingBuilder.php b/Plugin/Shipment/ShippingBuilder.php index a73f62c77..115562e1a 100644 --- a/Plugin/Shipment/ShippingBuilder.php +++ b/Plugin/Shipment/ShippingBuilder.php @@ -65,4 +65,15 @@ public function afterSetOrderId( $this->orderId = (int)$orderId; return $result; } + + public function afterSetOrder( + SubjectClass $subject, + $result, + $order + ) { + if ($order) { + $this->orderId = $order->getId(); + } + return $result; + } }