File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed
Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff 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 *
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments