Skip to content

Commit c63b49a

Browse files
committed
AC-3145: DHL Shipping- Domestic shipping not working
1 parent c3ad511 commit c63b49a

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

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

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1580,8 +1580,13 @@ protected function _doRequest()
15801580
* Shipment bill to account – required if Shipping PaymentType is other than 'S'
15811581
*/
15821582
$nodeBilling->addChild('BillingAccountNumber', (string)$this->getConfigData('account'));
1583-
$nodeBilling->addChild('DutyPaymentType', 'S');
1584-
$nodeBilling->addChild('DutyAccountNumber', (string)$this->getConfigData('account'));
1583+
if ($this->isDutiable(
1584+
$rawRequest->getShipperAddressCountryCode(),
1585+
$rawRequest->getRecipientAddressCountryCode()
1586+
)) {
1587+
$nodeBilling->addChild('DutyPaymentType', 'S');
1588+
$nodeBilling->addChild('DutyAccountNumber', (string)$this->getConfigData('account'));
1589+
}
15851590

15861591
/** Receiver */
15871592
$nodeConsignee = $xml->addChild('Consignee', '', '');
@@ -1789,7 +1794,10 @@ protected function _shipmentDetails($xml, $rawRequest, $originRegion = '')
17891794
$contentType = isset($package['params']['container']) ? $package['params']['container'] : '';
17901795
$packageType = $contentType === self::DHL_CONTENT_TYPE_NON_DOC ? 'CP' : 'EE';
17911796
$nodeShipmentDetails->addChild('PackageType', $packageType);
1792-
if ($this->isDutiable($rawRequest->getOrigCountryId(), $rawRequest->getDestCountryId())) {
1797+
if ($this->isDutiable(
1798+
$rawRequest->getShipperAddressCountryCode(),
1799+
$rawRequest->getRecipientAddressCountryCode()
1800+
)) {
17931801
$nodeShipmentDetails->addChild('IsDutiable', 'Y');
17941802
}
17951803
$nodeShipmentDetails->addChild(
@@ -2044,9 +2052,8 @@ protected function _checkDomesticStatus($origCountryCode, $destCountryCode)
20442052

20452053
$origCountry = (string)$this->getCountryParams($origCountryCode)->getData('name');
20462054
$destCountry = (string)$this->getCountryParams($destCountryCode)->getData('name');
2047-
$isDomestic = (string)$this->getCountryParams($destCountryCode)->getData('domestic');
20482055

2049-
if (($origCountry == $destCountry && $isDomestic)
2056+
if (($origCountry == $destCountry)
20502057
|| (
20512058
$this->_carrierHelper->isCountryInEU($origCountryCode)
20522059
&& $this->_carrierHelper->isCountryInEU($destCountryCode)

0 commit comments

Comments
 (0)