Skip to content

Commit ca14932

Browse files
committed
Merge remote-tracking branch 'origin/AC-9139' into Hammer_Platform_Health_Scope_21082023
2 parents 787c017 + fbe5ef7 commit ca14932

File tree

7 files changed

+69
-27
lines changed

7 files changed

+69
-27
lines changed

app/code/Magento/Usps/Helper/Data.php

Lines changed: 27 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -13,29 +13,37 @@
1313
class Data extends AbstractHelper
1414
{
1515
/**
16-
* Available shipping methods
16+
* USPS Allowed shipping methods
1717
*
1818
* @var array
1919
*/
2020
protected $availableShippingMethods = [
21-
'usps_0_FCLE', // First-Class Mail Large Envelope
22-
'usps_1', // Priority Mail
23-
'usps_2', // Priority Mail Express Hold For Pickup
24-
'usps_3', // Priority Mail Express
25-
'usps_4', // Retail Ground
26-
'usps_6', // Media Mail
27-
'usps_INT_1', // Priority Mail Express International
28-
'usps_INT_2', // Priority Mail International
29-
'usps_INT_4', // Global Express Guaranteed (GXG)
30-
'usps_INT_7', // Global Express Guaranteed Non-Document Non-Rectangular
31-
'usps_INT_8', // Priority Mail International Flat Rate Envelope
32-
'usps_INT_9', // Priority Mail International Medium Flat Rate Box
33-
'usps_INT_10', // Priority Mail Express International Flat Rate Envelope
34-
'usps_INT_11', // Priority Mail International Large Flat Rate Box
35-
'usps_INT_12', // USPS GXG Envelopes
36-
'usps_INT_14', // First-Class Mail International Large Envelope
37-
'usps_INT_16', // Priority Mail International Small Flat Rate Box
38-
'usps_INT_20', // Priority Mail International Small Flat Rate Envelope
21+
'usps_0_FCLE', // First-Class Mail Large Envelope
22+
'usps_1', // Priority Mail
23+
'usps_2', // Priority Mail Express Hold For Pickup
24+
'usps_3', // Priority Mail Express
25+
'usps_4', // Retail Ground
26+
'usps_6', // Media Mail
27+
'usps_INT_1', // Priority Mail Express International
28+
'usps_INT_2', // Priority Mail International
29+
'usps_INT_4', // Global Express Guaranteed (GXG)
30+
'usps_INT_7', // Global Express Guaranteed Non-Document Non-Rectangular
31+
'usps_INT_8', // Priority Mail International Flat Rate Envelope
32+
'usps_INT_9', // Priority Mail International Medium Flat Rate Box
33+
'usps_INT_10', // Priority Mail Express International Flat Rate Envelope
34+
'usps_INT_11', // Priority Mail International Large Flat Rate Box
35+
'usps_INT_12', // USPS GXG Envelopes
36+
'usps_INT_14', // First-Class Mail International Large Envelope
37+
'usps_INT_16', // Priority Mail International Small Flat Rate Box
38+
'usps_INT_20', // Priority Mail International Small Flat Rate Envelope
39+
'1058', // Ground Advantage™
40+
'4058', // Ground Advantage™ HAZMAT
41+
'6058', // Ground Advantage™ Parcel locker
42+
'2058', // Ground Advantage™ Hold for pickup
43+
'4096', // Ground Advantage™ Cubic HAZMAT
44+
'1096', // Ground Advantage™ Cubic
45+
'2096', // Ground Advantage™ Cubic Hold for pickup
46+
'6096', // Ground Advantage™ Cubic Parcel locker
3947
];
4048

4149
/**

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -815,6 +815,14 @@ public function getCode($type, $code = '')
815815
'INT_24' => __('Priority Mail International DVD Flat Rate priced box'),
816816
'INT_25' => __('Priority Mail International Large Video Flat Rate priced box'),
817817
'INT_27' => __('Priority Mail Express International Padded Flat Rate Envelope'),
818+
'1058' => __('Ground Advantage™'),
819+
'4058' => __('Ground Advantage™ HAZMAT'),
820+
'6058' => __('Ground Advantage™ Parcel locker'),
821+
'2058' => __('Ground Advantage™ Hold for pickup'),
822+
'4096' => __('Ground Advantage™ Cubic HAZMAT'),
823+
'1096' => __('Ground Advantage™ Cubic'),
824+
'2096' => __('Ground Advantage™ Cubic Hold for pickup'),
825+
'6096' => __('Ground Advantage™ Cubic Parcel locker')
818826
],
819827
'service_to_code' => [
820828
'0_FCLE' => 'First Class',
@@ -891,6 +899,14 @@ public function getCode($type, $code = '')
891899
'INT_24' => 'Priority',
892900
'INT_25' => 'Priority',
893901
'INT_27' => 'Priority Express',
902+
'1058' => 'Ground Advantage',
903+
'4058' => 'Ground Advantage',
904+
'6058' => 'Ground Advantage',
905+
'2058' => 'Ground Advantage',
906+
'4096' => 'Ground Advantage',
907+
'1096' => 'Ground Advantage',
908+
'2096' => 'Ground Advantage',
909+
'6096' => 'Ground Advantage',
894910
],
895911
'method_to_code' => [
896912
'First-Class Mail Large Envelope' => '0_FCLE',

app/code/Magento/Usps/Setup/Patch/Data/UpdateAllowedMethods.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@
1111
use Magento\Framework\Setup\Patch\PatchVersionInterface;
1212

1313
/**
14-
* Class UpdateAllowedMethods
15-
* @package Magento\Usps\Setup\Patch
14+
* Updates all methods on the configuration
1615
*/
1716
class UpdateAllowedMethods implements DataPatchInterface, PatchVersionInterface
1817
{
@@ -23,6 +22,7 @@ class UpdateAllowedMethods implements DataPatchInterface, PatchVersionInterface
2322

2423
/**
2524
* UpdateAllowedMethods constructor.
25+
*
2626
* @param \Magento\Framework\Setup\ModuleDataSetupInterface $moduleDataSetup
2727
*/
2828
public function __construct(
@@ -32,7 +32,7 @@ public function __construct(
3232
}
3333

3434
/**
35-
* {@inheritdoc}
35+
* @inheritdoc
3636
*/
3737
public function apply()
3838
{
@@ -113,26 +113,27 @@ public function apply()
113113
$connection->update($configDataTable, ['value' => $newValue], $whereConfigId);
114114
}
115115
}
116+
return $this;
116117
}
117118

118119
/**
119-
* {@inheritdoc}
120+
* @inheritdoc
120121
*/
121122
public static function getDependencies()
122123
{
123124
return [];
124125
}
125126

126127
/**
127-
* {@inheritdoc}
128+
* @inheritdoc
128129
*/
129130
public static function getVersion()
130131
{
131132
return '2.0.1';
132133
}
133134

134135
/**
135-
* {@inheritdoc}
136+
* @inheritdoc
136137
*/
137138
public function getAliases()
138139
{

app/code/Magento/Usps/Test/Unit/Helper/DataTest.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,14 @@ public function shippingMethodDataProvider()
7070
['usps_INT_14'], // First-Class Mail International Large Envelope
7171
['usps_INT_16'], // Priority Mail International Small Flat Rate Box
7272
['usps_INT_20'], // Priority Mail International Small Flat Rate Envelope
73+
['1058'], // Ground Advantage™
74+
['4058'], // Ground Advantage™ HAZMAT
75+
['6058'], // Ground Advantage™ Parcel locker
76+
['2058'], // Ground Advantage™ Hold for pickup
77+
['4096'], // Ground Advantage™ Cubic HAZMAT
78+
['1096'], // Ground Advantage™ Cubic
79+
['2096'], // Ground Advantage™ Cubic Hold for pickup
80+
['6096'], // Ground Advantage™ Cubic Parcel locker
7381
];
7482
}
7583
}

app/code/Magento/Usps/Test/Unit/Model/CarrierTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,8 @@ class CarrierTest extends TestCase
9090
private $config = [
9191
'carriers/usps/allowed_methods' => '0_FCLE,0_FCL,0_FCP,1,2,3,4,6,7,13,16,17,22,23,25,27,28,33,' .
9292
'34,35,36,37,42,43,53,55,56,57,61,INT_1,INT_2,INT_4,INT_6,INT_7,INT_8,INT_9,INT_10,INT_11,' .
93-
'INT_12,INT_13,INT_14,INT_15,INT_16,INT_20,INT_26',
93+
'INT_12,INT_13,INT_14,INT_15,INT_16,INT_20,INT_26,1058,4058,6058,2058,4096,' .
94+
'1096,2096,6096',
9495
'carriers/usps/showmethod' => 1,
9596
'carriers/usps/debug' => 1,
9697
'carriers/usps/userid' => 'test',

app/code/Magento/Usps/etc/config.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<usps>
1212
<active>0</active>
1313
<sallowspecific>0</sallowspecific>
14-
<allowed_methods>0_FCLE,0_FCL,0_FCP,1,2,3,4,6,7,13,16,17,22,23,25,27,28,33,34,35,36,37,42,43,53,57,61,INT_1,INT_2,INT_4,INT_6,INT_7,INT_8,INT_9,INT_10,INT_11,INT_12,INT_13,INT_14,INT_15,INT_16,INT_20</allowed_methods>
14+
<allowed_methods>0_FCLE,0_FCL,0_FCP,1,2,3,4,6,7,13,16,17,22,23,25,27,28,33,34,35,36,37,42,43,53,57,61,INT_1,INT_2,INT_4,INT_6,INT_7,INT_8,INT_9,INT_10,INT_11,INT_12,INT_13,INT_14,INT_15,INT_16,INT_20,1058,4058,6058,2058,4096,1096,2096,6096</allowed_methods>
1515
<container>VARIABLE</container>
1616
<cutoff_cost />
1717
<free_method />

app/code/Magento/Usps/i18n/en_US.csv

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,14 @@
7272
"Priority Mail International DVD Flat Rate priced box","Priority Mail International DVD Flat Rate priced box"
7373
"Priority Mail International Large Video Flat Rate priced box","Priority Mail International Large Video Flat Rate priced box"
7474
"Priority Mail Express International Padded Flat Rate Envelope","Priority Mail Express International Padded Flat Rate Envelope"
75+
"Ground Advantage™","Ground Advantage™"
76+
"Ground Advantage™ HAZMAT","Ground Advantage™ HAZMAT"
77+
"Ground Advantage™ Parcel locker","Ground Advantage™ Parcel locker"
78+
"Ground Advantage™ Hold for pickup","Ground Advantage™ Hold for pickup"
79+
"Ground Advantage™ Cubic HAZMAT","Ground Advantage™ Cubic HAZMAT"
80+
"Ground Advantage™ Cubic","Ground Advantage™ Cubic"
81+
"Ground Advantage™ Cubic Hold for pickup","Ground Advantage™ Cubic Hold for pickup"
82+
"Ground Advantage™ Cubic Parcel locker","Ground Advantage™ Cubic Parcel locker"
7583
Letter,Letter
7684
Flat,Flat
7785
Parcel,Parcel

0 commit comments

Comments
 (0)