File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,14 @@ abstract class AbstractCarrierOnline extends AbstractCarrier
29
29
30
30
const GUAM_REGION_CODE = 'GU ' ;
31
31
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
+
32
40
/**
33
41
* Array of quotes
34
42
*
Original file line number Diff line number Diff line change @@ -332,6 +332,14 @@ public function setRequest(RateRequest $request)
332
332
$ destCountry = self ::GUAM_COUNTRY_ID ;
333
333
}
334
334
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
+
335
343
$ country = $ this ->_countryFactory ->create ()->load ($ destCountry );
336
344
$ rowRequest ->setDestCountry ($ country ->getData ('iso2_code ' ) ?: $ destCountry );
337
345
@@ -1700,6 +1708,7 @@ public function getCustomizableContainerTypes()
1700
1708
1701
1709
/**
1702
1710
* Get delivery confirmation level based on origin/destination
1711
+ *
1703
1712
* Return null if delivery confirmation is not acceptable
1704
1713
*
1705
1714
* @param string|null $countyDestination
You can’t perform that action at this time.
0 commit comments