Skip to content

Commit bc36b09

Browse files
committed
Merge remote-tracking branch 'origin/MAGETWO-72305' into MPI-PR-Regression2
2 parents dd4eb14 + ab18b6c commit bc36b09

File tree

4 files changed

+28
-17
lines changed

4 files changed

+28
-17
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -643,7 +643,7 @@ public function getCode($type, $code = '')
643643
'method' => [
644644
'0_FCLE' => __('First-Class Mail Large Envelope'),
645645
'0_FCL' => __('First-Class Mail Letter'),
646-
'0_FCP' => __('First-Class Mail Parcel'),
646+
'0_FCP' => __('First-Class Package Service - Retail'),
647647
'0_FCPC' => __('First-Class Mail Postcards'),
648648
'1' => __('Priority Mail'),
649649
'2' => __('Priority Mail Express Hold For Pickup'),
@@ -795,7 +795,7 @@ public function getCode($type, $code = '')
795795
'method_to_code' => [
796796
'First-Class Mail Large Envelope' => '0_FCLE',
797797
'First-Class Mail Letter' => '0_FCL',
798-
'First-Class Mail Parcel' => '0_FCP',
798+
'First-Class Package Service - Retail' => '0_FCP',
799799
],
800800
'first_class_mail_type' => ['LETTER' => __('Letter'), 'FLAT' => __('Flat'), 'PARCEL' => __('Parcel')],
801801
'container' => [

app/code/Magento/Usps/Setup/InstallData.php renamed to app/code/Magento/Usps/Setup/UpgradeData.php

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,29 @@
66

77
namespace Magento\Usps\Setup;
88

9-
use Magento\Framework\Setup\InstallDataInterface;
109
use Magento\Framework\Setup\ModuleContextInterface;
1110
use Magento\Framework\Setup\ModuleDataSetupInterface;
11+
use Magento\Framework\Setup\UpgradeDataInterface;
1212

13-
/**
14-
* @codeCoverageIgnore
15-
*/
16-
class InstallData implements InstallDataInterface
13+
class UpgradeData implements UpgradeDataInterface
1714
{
1815
/**
19-
* {@inheritdoc}
16+
* @inheritdoc
17+
*/
18+
public function upgrade(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
19+
{
20+
if (version_compare($context->getVersion(), '2.0.1', '<')) {
21+
$this->updateAllowedMethods($setup);
22+
}
23+
}
24+
25+
/**
26+
* Replaces titles of allowed shipping methods to their codes.
27+
*
28+
* @param ModuleDataSetupInterface $setup
29+
* @return void
2030
*/
21-
public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
31+
private function updateAllowedMethods(ModuleDataSetupInterface $setup)
2232
{
2333
$installer = $setup;
2434
$configDataTable = $installer->getTable('core_config_data');
@@ -39,6 +49,7 @@ public function install(ModuleDataSetupInterface $setup, ModuleContextInterface
3949
'First-Class Mail Letter' => '0_FCL',
4050
'First-Class Mail Parcel' => '0_FCP',
4151
'First-Class Mail Package' => '0_FCP',
52+
'First-Class Package Service - Retail' => '0_FCP',
4253
'Parcel Post' => '4',
4354
'Retail Ground' => '4',
4455
'Media Mail' => '6',
@@ -68,12 +79,12 @@ public function install(ModuleDataSetupInterface $setup, ModuleContextInterface
6879
'Priority Mail International Large Flat Rate Box' => 'INT_11',
6980
];
7081

71-
$select = $connection->select()->from(
72-
$configDataTable
73-
)->where(
74-
'path IN (?)',
75-
['carriers/usps/free_method', 'carriers/usps/allowed_methods']
76-
);
82+
$select = $connection->select()
83+
->from($configDataTable)
84+
->where(
85+
'path IN (?)',
86+
['carriers/usps/free_method', 'carriers/usps/allowed_methods']
87+
);
7788
$oldConfigValues = $connection->fetchAll($select);
7889

7990
foreach ($oldConfigValues as $oldValue) {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66
*/
77
-->
88
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
9-
<module name="Magento_Usps" setup_version="2.0.0">
9+
<module name="Magento_Usps" setup_version="2.0.1">
1010
</module>
1111
</config>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"First-Class Mail Large Envelope","First-Class Mail Large Envelope"
22
"First-Class Mail Letter","First-Class Mail Letter"
3-
"First-Class Mail Parcel","First-Class Mail Parcel"
3+
"First-Class Package Service - Retail","First-Class Package Service - Retail"
44
"First-Class Mail Postcards","First-Class Mail Postcards"
55
"Priority Mail","Priority Mail"
66
"Priority Mail Express Hold For Pickup","Priority Mail Express Hold For Pickup"

0 commit comments

Comments
 (0)