diff --git a/src/Model/GetInventoryRequestFromOrder.php b/src/Model/GetInventoryRequestFromOrder.php index 19ea768..29ff5c3 100644 --- a/src/Model/GetInventoryRequestFromOrder.php +++ b/src/Model/GetInventoryRequestFromOrder.php @@ -113,11 +113,13 @@ private function getAddressFromOrder(OrderInterface $order): ?AddressInterface return null; } + $region = $shippingAddress->getRegion() === '' ? null : $shippingAddress->getRegion(); + return $this->addressInterfaceFactory->create([ 'country' => $shippingAddress->getCountryId(), 'postcode' => $shippingAddress->getPostcode(), 'street' => implode("\n", $shippingAddress->getStreet()), - 'region' => $shippingAddress->getRegion() ?? $shippingAddress->getRegionCode() ?? '', + 'region' => $region ?? $shippingAddress->getRegionCode() ?? '', 'city' => $shippingAddress->getCity() ]); }