Skip to content

Commit 1a0ecd6

Browse files
committed
For UPS, Las Palmas and Santa Cruz de Tenerife will be represented by Canary Islands country
1 parent a392746 commit 1a0ecd6

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

app/code/Magento/Ups/Model/Carrier.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,14 @@ public function setRequest(RateRequest $request)
334334
$destCountry = self::GUAM_COUNTRY_ID;
335335
}
336336

337+
// For UPS, Las Palmas and Santa Cruz de Tenerife will be represented by Canary Islands country
338+
if (
339+
$destCountry == self::SPAIN_COUNTRY_ID &&
340+
($request->getDestRegionCode() == self::LAS_PALMAS_REGION_ID || $request->getDestRegionCode() == self::SANTA_CRUZ_DE_TENERIFE_REGION_ID)
341+
) {
342+
$destCountry = self::CANARY_ISLANDS_COUNTRY_ID;
343+
}
344+
337345
$country = $this->_countryFactory->create()->load($destCountry);
338346
$rowRequest->setDestCountry($country->getData('iso2_code') ?: $destCountry);
339347

0 commit comments

Comments
 (0)