Skip to content

Commit ba1a339

Browse files
authored
Fix wrong format error DHL shipping label
Fix "The response is in wrong format." error while generating dhl shipping label. When product name has unicode characters substr() is sending � in <PieceContents> causing erros dhl syntax errors.
1 parent f55f411 commit ba1a339

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1748,7 +1748,7 @@ protected function _shipmentDetails($xml, $rawRequest, $originRegion = '')
17481748
foreach ($package['items'] as $item) {
17491749
$content[] = $item['name'];
17501750
}
1751-
$nodePiece->addChild('PieceContents', substr(implode(',', $content), 0, 34));
1751+
$nodePiece->addChild('PieceContents', $this->string->substr(implode(',', $content), 0, 34));
17521752
}
17531753

17541754
$nodeShipmentDetails->addChild('Weight', sprintf('%.3f', $rawRequest->getPackageWeight()));

0 commit comments

Comments
 (0)