Skip to content

[Backport #12666 into 2.3-develop] Fix incorrect DHL Product codes #12905

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 3, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/code/Magento/Dhl/Model/Carrier.php
Original file line number Diff line number Diff line change
Expand Up @@ -606,7 +606,7 @@ 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' => __('Others'),
'R' => __('Globalmail business'),
Expand All @@ -616,7 +616,7 @@ public function getDhlProducts($doc)
];

$nonDocType = [
'1' => __('Customer services'),
'1' => __('Domestic express 12:00'),
'3' => __('Easy shop'),
'4' => __('Jetline'),
'8' => __('Express easy'),
Expand Down
63 changes: 63 additions & 0 deletions app/code/Magento/Dhl/Test/Unit/Model/CarrierTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
]
]
];
}
}
4 changes: 2 additions & 2 deletions app/code/Magento/Dhl/i18n/en_US.csv
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,12 @@ 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"
Expand Down Expand Up @@ -81,3 +79,5 @@ 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 12:00","Domestic express 12:00"