Problem

The receiver's phone number is not printed onto the DHL label.


Cause

To increase data protection, the phone number is not transmitted to DHL anymore. This behaviour is intended and correct.


Modification

To get the receiver's phone number onto the DHL label, you can do the following.


DHL Shipping 0.11.x

Edit the file module-shipping-m2/Webservice/BcsDataMapper.php


Look for this code section (around line 310):

$communicationType = new BcsApi\CommunicationType();
        $communicationType->setContactPerson($receiver->getContactPerson());
        if (array_key_exists(ParcelAnnouncement::CODE, $shipmentOrder->getServices())) {
            $communicationType->setEmail($receiver->getEmail());
        }

After the IF-condition, add the shown line:

$communicationType = new BcsApi\CommunicationType();
        $communicationType->setContactPerson($receiver->getContactPerson());
        if (array_key_exists(ParcelAnnouncement::CODE, $shipmentOrder->getServices())) {
            $communicationType->setEmail($receiver->getEmail());
        }
        $communicationType->setPhone($receiver->getPhone());


DHL Shipping 1.x

Edit the file module-carrier-paket/Model/Pipeline/CreateShipments/RequestDataMapper.php


Look for this code section (around line 126):

$requestExtractor->getRecipient()->getContactCompanyName(),
null,
$recipientEmail,
null,
null,

Replace the entry "null" below the line "$recipientEmail" as shown here:

$requestExtractor->getRecipient()->getContactCompanyName(),
null,
$recipientEmail,
$requestExtractor->getRecipient()->getContactPhoneNumber(),
null,


Please note that these modifications will be lost during an update and must be re-applied afterwards.