From 2b0f515a9d1037dee037bb7e38f7b505775c3ba3 Mon Sep 17 00:00:00 2001 From: Dmytro Kaplin Date: Thu, 20 Nov 2025 12:17:32 +0100 Subject: [PATCH] Resolved an issue with Commercial addresses for the UPS carrier. Empty value for the field ResidentialAddressIndicator is not correct --- app/code/Magento/Ups/Model/Carrier.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Ups/Model/Carrier.php b/app/code/Magento/Ups/Model/Carrier.php index f96e595acfab2..0db72e5f8fcdd 100644 --- a/app/code/Magento/Ups/Model/Carrier.php +++ b/app/code/Magento/Ups/Model/Carrier.php @@ -1118,8 +1118,7 @@ protected function _getRestQuotes() "AddressLine" => ["{$params['49_residential']}"], "StateProvinceCode" => "{$params['destRegionCode']}", "PostalCode" => "{$params['19_destPostal']}", - "CountryCode" => "{$params['22_destCountry']}", - "ResidentialAddressIndicator" => "{$residentialAddressIndicator}" + "CountryCode" => "{$params['22_destCountry']}" ] ], "ShipFrom" => [ @@ -1134,6 +1133,11 @@ protected function _getRestQuotes() ] ]; + if ($params['49_residential'] === '01') { + $rateParams['RateRequest']['Shipment']['ShipTo']['Address']['ResidentialAddressIndicator'] + = $residentialAddressIndicator; + } + if ($this->getConfigFlag('negotiated_active')) { $rateParams['RateRequest']['Shipment']['ShipmentRatingOptions']['TPFCNegotiatedRatesIndicator'] = "Y"; $rateParams['RateRequest']['Shipment']['ShipmentRatingOptions']['NegotiatedRatesIndicator'] = "Y";