Skip to content

Commit 818d1a1

Browse files
authored
ENGCOM-4005: [Backport]#20222 Canary islands in ups carrier 2.2 #20285
2 parents d0e3007 + f9fc94e commit 818d1a1

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

app/code/Magento/Shipping/Model/Carrier/AbstractCarrierOnline.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,14 @@ abstract class AbstractCarrierOnline extends AbstractCarrier
2828

2929
const GUAM_REGION_CODE = 'GU';
3030

31+
const SPAIN_COUNTRY_ID = 'ES';
32+
33+
const CANARY_ISLANDS_COUNTRY_ID = 'IC';
34+
35+
const SANTA_CRUZ_DE_TENERIFE_REGION_ID = 'Santa Cruz de Tenerife';
36+
37+
const LAS_PALMAS_REGION_ID = 'Las Palmas';
38+
3139
/**
3240
* Array of quotes
3341
*

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)