Skip to content

Commit

Permalink
ENGCOM-3850: Las Palmas and Tenerife should be represented by Canary …
Browse files Browse the repository at this point in the history
…Islands in UPS #20222
  • Loading branch information
sidolov authored Jan 22, 2019
2 parents 5e04c4c + 12ee58c commit 6457701
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,14 @@ abstract class AbstractCarrierOnline extends AbstractCarrier

const GUAM_REGION_CODE = 'GU';

const SPAIN_COUNTRY_ID = 'ES';

const CANARY_ISLANDS_COUNTRY_ID = 'IC';

const SANTA_CRUZ_DE_TENERIFE_REGION_ID = 'Santa Cruz de Tenerife';

const LAS_PALMAS_REGION_ID = 'Las Palmas';

/**
* Array of quotes
*
Expand Down
9 changes: 9 additions & 0 deletions app/code/Magento/Ups/Model/Carrier.php
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,14 @@ public function setRequest(RateRequest $request)
$destCountry = self::GUAM_COUNTRY_ID;
}

// For UPS, Las Palmas and Santa Cruz de Tenerife will be represented by Canary Islands country
if ($destCountry === self::SPAIN_COUNTRY_ID &&
($request->getDestRegionCode() === self::LAS_PALMAS_REGION_ID
|| $request->getDestRegionCode() === self::SANTA_CRUZ_DE_TENERIFE_REGION_ID)
) {
$destCountry = self::CANARY_ISLANDS_COUNTRY_ID;
}

$country = $this->_countryFactory->create()->load($destCountry);
$rowRequest->setDestCountry($country->getData('iso2_code') ?: $destCountry);

Expand Down Expand Up @@ -1700,6 +1708,7 @@ public function getCustomizableContainerTypes()

/**
* Get delivery confirmation level based on origin/destination
*
* Return null if delivery confirmation is not acceptable
*
* @param string|null $countyDestination
Expand Down

0 comments on commit 6457701

Please sign in to comment.