When we put Hong Kong Address as shipping. Hong Kong address is saved properly. For some time we face this issue, that it's not displaying Shipping Fee.
City as as Hong Kong.
It's already in the Cart & Quote Session may be.
Request
<?xml version="1.0" encoding="UTF-8"?>
<p:DCTRequest xmlns:p="http://www.dhl.com" xmlns:p1="http://www.dhl.com/datatypes" xmlns:p2="http://www.dhl.com/DCTRequestdatatypes" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.dhl.com DCT-req.xsd ">
<GetQuote>
<Request>
<ServiceHeader>
<SiteID>****</SiteID>
<Password>****</Password>
</ServiceHeader>
</Request>
<From>
<CountryCode>SG</CountryCode>
<Postalcode>666666</Postalcode>
<City>SINGAPORE</City>
</From>
<BkgDetails>
<PaymentCountryCode>SG</PaymentCountryCode>
<Date>2016-12-21</Date>
<ReadyTime>PT0H00M</ReadyTime>
<DimensionUnit>CM</DimensionUnit>
<WeightUnit>KG</WeightUnit>
<Pieces>
<Piece>
<PieceID>1</PieceID>
<Weight>5</Weight>
</Piece>
</Pieces>
<PaymentAccountNumber>610461741</PaymentAccountNumber>
<IsDutiable>Y</IsDutiable>
</BkgDetails>
<To>
<CountryCode>HK</CountryCode>
<Postalcode />
<City />
</To>
<Dutiable>
<DeclaredCurrency>SGD</DeclaredCurrency>
<DeclaredValue>130.00</DeclaredValue>
</Dutiable>
</GetQuote>
</p:DCTRequest>
Response
<?xml version="1.0" encoding="UTF-8"?>
<res:DCTResponse xmlns:res="http://www.dhl.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.dhl.com DCT-Response.xsd">
<GetQuoteResponse>
<Response>
<ServiceHeader>
<MessageTime>2016-12-21T11:19:08.434+01:00</MessageTime>
<SiteID>****</SiteID>
</ServiceHeader>
</Response>
<Note>
<Condition>
<ConditionCode>3021</ConditionCode>
<ConditionData>The destination country HK location postal code or City is invalid. Please check the destination country location details.</ConditionData>
</Condition>
</Note>
</GetQuoteResponse>
</res:DCTResponse>
So in Hong Kong we don't have Zip Code. But we have put City & it's saved in Magento DB, but it's not passing to DHL API
By clicking on Shipping Address it's calling this AJAX Request
domain.com/rest/default/V1/carts/mine/estimate-shipping-methods-by-address-id
There is something issue with Quote Session, because it's not passing needed info to DHL API
[UPDATE]
magento/vendor/magento/module-dhl/Model/Carrier.php
In _buildQuotesRequestXml()
$nodeTo->addChild('City', $rawRequest->getDestCity());
It's not getting value. It always blank for ANY country's city.
It's sometime showing DHL Shipping Fee & sometimes not. It's annonying. Hard to find what's going wrong.
Magento is saying issue is solved in Developer Branch.
https://github.com/magento/magento2/issues/3789
MAGETWO-55117
How to get fix & apply for now?