Skip to content

Commit b58af23

Browse files
ENGCOM-3850: Las Palmas and Tenerife should be represented by Canary Islands in UPS #20222
- Merge Pull Request #20222 from duckchip/magento2:canary_islands_in_ups_carrier - Merged commits: 1. 9286183 2. eab5472
2 parents b8e3a0b + eab5472 commit b58af23

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
@@ -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: 8 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 (
337+
$destCountry == self::SPAIN_COUNTRY_ID &&
338+
($request->getDestRegionCode() == self::LAS_PALMAS_REGION_ID || $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

0 commit comments

Comments
 (0)