Skip to content

Commit 6457701

Browse files
authored
ENGCOM-3850: Las Palmas and Tenerife should be represented by Canary Islands in UPS #20222
2 parents 5e04c4c + 12ee58c commit 6457701

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-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
@@ -29,6 +29,14 @@ abstract class AbstractCarrierOnline extends AbstractCarrier
2929

3030
const GUAM_REGION_CODE = 'GU';
3131

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

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

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

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

@@ -1700,6 +1708,7 @@ public function getCustomizableContainerTypes()
17001708

17011709
/**
17021710
* Get delivery confirmation level based on origin/destination
1711+
*
17031712
* Return null if delivery confirmation is not acceptable
17041713
*
17051714
* @param string|null $countyDestination

0 commit comments

Comments
 (0)