From 4d5ea55540002dcdfb47784943fab60c5f5dde07 Mon Sep 17 00:00:00 2001 From: gwharton Date: Wed, 13 Dec 2017 10:39:01 +0000 Subject: [PATCH 1/7] Updated Product Codes Updated product codes for Products I, O and 1 in accordance with DHL Document DHLIS1 - Products and Services Version 2.1 Legacy product codes, no longer listed in the above document left in place and not changed. http://www.dhl.co.uk/content/dam/downloads/uk/Express/PDFs/developer_centre/dhlis1_products_and_services.pdf --- app/code/Magento/Dhl/Model/Carrier.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Dhl/Model/Carrier.php b/app/code/Magento/Dhl/Model/Carrier.php index 45a97e2287827..41c00cb822ce4 100644 --- a/app/code/Magento/Dhl/Model/Carrier.php +++ b/app/code/Magento/Dhl/Model/Carrier.php @@ -607,8 +607,9 @@ public function getDhlProducts($doc) 'G' => __('Domestic economy select'), 'W' => __('Economy select'), 'I' => __('Break bulk economy'), + 'I' => __('Domestic express 9:00'), 'N' => __('Domestic express'), - 'O' => __('Others'), + 'O' => __('Domestic express 10:30'), 'R' => __('Globalmail business'), 'S' => __('Same day'), 'T' => __('Express 12:00'), @@ -616,7 +617,7 @@ public function getDhlProducts($doc) ]; $nonDocType = [ - '1' => __('Customer services'), + '1' => __('Domestic express 12:00'), '3' => __('Easy shop'), '4' => __('Jetline'), '8' => __('Express easy'), From 30a426bd996a5bb95e2bcf2a7a99ed02774a9171 Mon Sep 17 00:00:00 2001 From: gwharton Date: Wed, 13 Dec 2017 10:44:18 +0000 Subject: [PATCH 2/7] Removed old code "I" Old code "I" was not removed in initial commit for some reason. --- app/code/Magento/Dhl/Model/Carrier.php | 1 - 1 file changed, 1 deletion(-) diff --git a/app/code/Magento/Dhl/Model/Carrier.php b/app/code/Magento/Dhl/Model/Carrier.php index 41c00cb822ce4..a9bdc99e8dcdd 100644 --- a/app/code/Magento/Dhl/Model/Carrier.php +++ b/app/code/Magento/Dhl/Model/Carrier.php @@ -606,7 +606,6 @@ public function getDhlProducts($doc) 'L' => __('Express 10:30'), 'G' => __('Domestic economy select'), 'W' => __('Economy select'), - 'I' => __('Break bulk economy'), 'I' => __('Domestic express 9:00'), 'N' => __('Domestic express'), 'O' => __('Domestic express 10:30'), From a6abc596a1e5a6c901cc721393000e8e25e6dff5 Mon Sep 17 00:00:00 2001 From: gwharton Date: Wed, 13 Dec 2017 10:54:28 +0000 Subject: [PATCH 3/7] Updated i18n Added product codes to i18n --- app/code/Magento/Dhl/i18n/en_US.csv | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/code/Magento/Dhl/i18n/en_US.csv b/app/code/Magento/Dhl/i18n/en_US.csv index 90ec8b5f17a22..412f69af14b09 100644 --- a/app/code/Magento/Dhl/i18n/en_US.csv +++ b/app/code/Magento/Dhl/i18n/en_US.csv @@ -81,3 +81,6 @@ Size,Size "Show Method if Not Applicable","Show Method if Not Applicable" "Sort Order","Sort Order" Debug,Debug +Domestic express 9:00,Domestic express 9:00 +Domestic express 10:30,Domestic express 10:30 +Domestic express 12:00,Domestic express 12:00 From b422f2c8ad83127a725d12336c5bd287c745128d Mon Sep 17 00:00:00 2001 From: gwharton Date: Wed, 13 Dec 2017 10:57:21 +0000 Subject: [PATCH 4/7] Removed legacy codes from i18n These codes have been renamed, so entries removed from i18n --- app/code/Magento/Dhl/i18n/en_US.csv | 3 --- 1 file changed, 3 deletions(-) diff --git a/app/code/Magento/Dhl/i18n/en_US.csv b/app/code/Magento/Dhl/i18n/en_US.csv index 412f69af14b09..27c36bb466b86 100644 --- a/app/code/Magento/Dhl/i18n/en_US.csv +++ b/app/code/Magento/Dhl/i18n/en_US.csv @@ -23,14 +23,11 @@ Europack,Europack "Express 10:30","Express 10:30" "Domestic economy select","Domestic economy select" "Economy select","Economy select" -"Break bulk economy","Break bulk economy" "Domestic express","Domestic express" -Others,Others "Globalmail business","Globalmail business" "Same day","Same day" "Express 12:00","Express 12:00" "Express envelope","Express envelope" -"Customer services","Customer services" Jetline,Jetline "Freight worldwide","Freight worldwide" "Jumbo box","Jumbo box" From 2ba87c689ef2a8d356ddd5a986a9fa2abd9e13ce Mon Sep 17 00:00:00 2001 From: gwharton Date: Wed, 13 Dec 2017 10:59:36 +0000 Subject: [PATCH 5/7] Fixed quotes around strings Added quotes around strings in i18n --- app/code/Magento/Dhl/i18n/en_US.csv | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/code/Magento/Dhl/i18n/en_US.csv b/app/code/Magento/Dhl/i18n/en_US.csv index 27c36bb466b86..998cc51c63653 100644 --- a/app/code/Magento/Dhl/i18n/en_US.csv +++ b/app/code/Magento/Dhl/i18n/en_US.csv @@ -78,6 +78,6 @@ Size,Size "Show Method if Not Applicable","Show Method if Not Applicable" "Sort Order","Sort Order" Debug,Debug -Domestic express 9:00,Domestic express 9:00 -Domestic express 10:30,Domestic express 10:30 -Domestic express 12:00,Domestic express 12:00 +"Domestic express 9:00","Domestic express 9:00" +"Domestic express 10:30","Domestic express 10:30" +"Domestic express 12:00","Domestic express 12:00" From f99ae4ddf32873bed7e6e1cb5a2237a84fe4ff16 Mon Sep 17 00:00:00 2001 From: gwharton Date: Wed, 13 Dec 2017 15:51:15 +0000 Subject: [PATCH 6/7] Reverted change for product code "O" Product code "O" changed in error. This reverts the change. --- app/code/Magento/Dhl/Model/Carrier.php | 2 +- app/code/Magento/Dhl/i18n/en_US.csv | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Dhl/Model/Carrier.php b/app/code/Magento/Dhl/Model/Carrier.php index a9bdc99e8dcdd..9a26efee744d5 100644 --- a/app/code/Magento/Dhl/Model/Carrier.php +++ b/app/code/Magento/Dhl/Model/Carrier.php @@ -608,7 +608,7 @@ public function getDhlProducts($doc) 'W' => __('Economy select'), 'I' => __('Domestic express 9:00'), 'N' => __('Domestic express'), - 'O' => __('Domestic express 10:30'), + 'O' => __('Others'), 'R' => __('Globalmail business'), 'S' => __('Same day'), 'T' => __('Express 12:00'), diff --git a/app/code/Magento/Dhl/i18n/en_US.csv b/app/code/Magento/Dhl/i18n/en_US.csv index 998cc51c63653..a5532c2cea963 100644 --- a/app/code/Magento/Dhl/i18n/en_US.csv +++ b/app/code/Magento/Dhl/i18n/en_US.csv @@ -24,6 +24,7 @@ Europack,Europack "Domestic economy select","Domestic economy select" "Economy select","Economy select" "Domestic express","Domestic express" +Others,Others "Globalmail business","Globalmail business" "Same day","Same day" "Express 12:00","Express 12:00" @@ -79,5 +80,4 @@ Size,Size "Sort Order","Sort Order" Debug,Debug "Domestic express 9:00","Domestic express 9:00" -"Domestic express 10:30","Domestic express 10:30" "Domestic express 12:00","Domestic express 12:00" From cc10dc1d4f6ca7e2d88fd05122facacc0d0cf5ae Mon Sep 17 00:00:00 2001 From: Stanislav Idolov Date: Thu, 14 Dec 2017 09:12:33 +0200 Subject: [PATCH 7/7] magento/magento2#12666 --- .../Dhl/Test/Unit/Model/CarrierTest.php | 63 +++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/app/code/Magento/Dhl/Test/Unit/Model/CarrierTest.php b/app/code/Magento/Dhl/Test/Unit/Model/CarrierTest.php index 0f0d784813dfc..8738d3bb8dae2 100644 --- a/app/code/Magento/Dhl/Test/Unit/Model/CarrierTest.php +++ b/app/code/Magento/Dhl/Test/Unit/Model/CarrierTest.php @@ -447,4 +447,67 @@ public function requestToShipmentDataProvider() ] ]; } + + /** + * @dataProvider dhlProductsDataProvider + * + * @param string $docType + * @param array $products + */ + public function testGetDhlProducts(string $docType, array $products) + { + $this->assertEquals($products, $this->model->getDhlProducts($docType)); + } + + /** + * @return array + */ + public function dhlProductsDataProvider() : array + { + return [ + 'doc' => [ + 'docType' => \Magento\Dhl\Model\Carrier::DHL_CONTENT_TYPE_DOC, + 'products' => [ + '2' => 'Easy shop', + '5' => 'Sprintline', + '6' => 'Secureline', + '7' => 'Express easy', + '9' => 'Europack', + 'B' => 'Break bulk express', + 'C' => 'Medical express', + 'D' => 'Express worldwide', + 'U' => 'Express worldwide', + 'K' => 'Express 9:00', + 'L' => 'Express 10:30', + 'G' => 'Domestic economy select', + 'W' => 'Economy select', + 'I' => 'Domestic express 9:00', + 'N' => 'Domestic express', + 'O' => 'Others', + 'R' => 'Globalmail business', + 'S' => 'Same day', + 'T' => 'Express 12:00', + 'X' => 'Express envelope', + ] + ], + 'non-doc' => [ + 'docType' => \Magento\Dhl\Model\Carrier::DHL_CONTENT_TYPE_NON_DOC, + 'products' => [ + '1' => 'Domestic express 12:00', + '3' => 'Easy shop', + '4' => 'Jetline', + '8' => 'Express easy', + 'P' => 'Express worldwide', + 'Q' => 'Medical express', + 'E' => 'Express 9:00', + 'F' => 'Freight worldwide', + 'H' => 'Economy select', + 'J' => 'Jumbo box', + 'M' => 'Express 10:30', + 'V' => 'Europack', + 'Y' => 'Express 12:00', + ] + ] + ]; + } }