From c0c42efb28a2b4ecd9b5beb2b3f79e0d4994613c Mon Sep 17 00:00:00 2001 From: mbe Date: Thu, 19 Dec 2024 14:32:27 +0100 Subject: [PATCH] #37425 bugfix for custom label with no preselected services --- .../mo/mo_dhl/Adapter/ParcelShippingCustomRequestBuilder.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/mo/mo_dhl/Adapter/ParcelShippingCustomRequestBuilder.php b/src/modules/mo/mo_dhl/Adapter/ParcelShippingCustomRequestBuilder.php index 3feea23..9c04d99 100644 --- a/src/modules/mo/mo_dhl/Adapter/ParcelShippingCustomRequestBuilder.php +++ b/src/modules/mo/mo_dhl/Adapter/ParcelShippingCustomRequestBuilder.php @@ -37,7 +37,7 @@ class ParcelShippingCustomRequestBuilder public function toCustomizableParametersArray($query, Shipment $shipment, $order): array { $shipper = $shipment->getShipper(); - $services = $shipment->getServices(); + $services = $shipment->isInitialized('services') ? $shipment->getServices() : new VAS(); $returnReceiver = $services->isInitialized('dhlRetoure') ? $services->getDhlRetoure()->getReturnAddress() : oxNew(ParcelShippingRequestBuilder::class)->buildReturnReceiver(); $codAmount = $services->isInitialized('cashOnDelivery') ? $services->getCashOnDelivery()->getAmount() : oxNew(ParcelShippingRequestBuilder::class)->createCashOnDelivery($order)->getAmount(); return [