Skip to content

Commit ee857ea

Browse files
author
Oleksii Korshenko
authored
MAGETWO-85586: Fix incorrect DHL Product codes #12666
2 parents c8cad08 + 6faf6fd commit ee857ea

File tree

3 files changed

+67
-4
lines changed

3 files changed

+67
-4
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,7 @@ public function getDhlProducts($doc)
606606
'L' => __('Express 10:30'),
607607
'G' => __('Domestic economy select'),
608608
'W' => __('Economy select'),
609-
'I' => __('Break bulk economy'),
609+
'I' => __('Domestic express 9:00'),
610610
'N' => __('Domestic express'),
611611
'O' => __('Others'),
612612
'R' => __('Globalmail business'),
@@ -616,7 +616,7 @@ public function getDhlProducts($doc)
616616
];
617617

618618
$nonDocType = [
619-
'1' => __('Customer services'),
619+
'1' => __('Domestic express 12:00'),
620620
'3' => __('Easy shop'),
621621
'4' => __('Jetline'),
622622
'8' => __('Express easy'),

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

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -447,4 +447,67 @@ public function requestToShipmentDataProvider()
447447
]
448448
];
449449
}
450+
451+
/**
452+
* @dataProvider dhlProductsDataProvider
453+
*
454+
* @param string $docType
455+
* @param array $products
456+
*/
457+
public function testGetDhlProducts(string $docType, array $products)
458+
{
459+
$this->assertEquals($products, $this->model->getDhlProducts($docType));
460+
}
461+
462+
/**
463+
* @return array
464+
*/
465+
public function dhlProductsDataProvider() : array
466+
{
467+
return [
468+
'doc' => [
469+
'docType' => \Magento\Dhl\Model\Carrier::DHL_CONTENT_TYPE_DOC,
470+
'products' => [
471+
'2' => 'Easy shop',
472+
'5' => 'Sprintline',
473+
'6' => 'Secureline',
474+
'7' => 'Express easy',
475+
'9' => 'Europack',
476+
'B' => 'Break bulk express',
477+
'C' => 'Medical express',
478+
'D' => 'Express worldwide',
479+
'U' => 'Express worldwide',
480+
'K' => 'Express 9:00',
481+
'L' => 'Express 10:30',
482+
'G' => 'Domestic economy select',
483+
'W' => 'Economy select',
484+
'I' => 'Domestic express 9:00',
485+
'N' => 'Domestic express',
486+
'O' => 'Others',
487+
'R' => 'Globalmail business',
488+
'S' => 'Same day',
489+
'T' => 'Express 12:00',
490+
'X' => 'Express envelope',
491+
]
492+
],
493+
'non-doc' => [
494+
'docType' => \Magento\Dhl\Model\Carrier::DHL_CONTENT_TYPE_NON_DOC,
495+
'products' => [
496+
'1' => 'Domestic express 12:00',
497+
'3' => 'Easy shop',
498+
'4' => 'Jetline',
499+
'8' => 'Express easy',
500+
'P' => 'Express worldwide',
501+
'Q' => 'Medical express',
502+
'E' => 'Express 9:00',
503+
'F' => 'Freight worldwide',
504+
'H' => 'Economy select',
505+
'J' => 'Jumbo box',
506+
'M' => 'Express 10:30',
507+
'V' => 'Europack',
508+
'Y' => 'Express 12:00',
509+
]
510+
]
511+
];
512+
}
450513
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,12 @@ Europack,Europack
2323
"Express 10:30","Express 10:30"
2424
"Domestic economy select","Domestic economy select"
2525
"Economy select","Economy select"
26-
"Break bulk economy","Break bulk economy"
2726
"Domestic express","Domestic express"
2827
Others,Others
2928
"Globalmail business","Globalmail business"
3029
"Same day","Same day"
3130
"Express 12:00","Express 12:00"
3231
"Express envelope","Express envelope"
33-
"Customer services","Customer services"
3432
Jetline,Jetline
3533
"Freight worldwide","Freight worldwide"
3634
"Jumbo box","Jumbo box"
@@ -81,3 +79,5 @@ Size,Size
8179
"Show Method if Not Applicable","Show Method if Not Applicable"
8280
"Sort Order","Sort Order"
8381
Debug,Debug
82+
"Domestic express 9:00","Domestic express 9:00"
83+
"Domestic express 12:00","Domestic express 12:00"

0 commit comments

Comments
 (0)