1

I have set the shipping origin country as Afghanistan in the Stores-->Settings-->Configuration-->Sales-->Shipping Settings->Origin, but the checkout shows "This shipping method is currently unavailable. If you would like to ship using this shipping method, please contact us.

The origin address:

  • Country: Afghanistan
  • Region/State: Kabul
  • ZIP/Postal Code: 1007
  • City:Kabul
  • Street Address: Old Taimani, Street no 3

The destination address: enter image description here The shipping.log file under /var/log/ also shows that DHL methods and rates are returned for Afghanistan as shipping origin, it is just that they are not shown on the frontend in the checkout page.

The contents of the shipping.log file

[2021-02-17 06:48:30] main.DEBUG: array (
  'request' => '<?xml version="1.0" encoding="UTF-8"?>
<req:DCTRequest xmlns:req="http://www.dhl.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" schemaVersion="2.0" xsi:schemaLocation="http://www.dhl.com DCT-req_global-2.0.xsd"><GetQuote xmlns=""><Request><ServiceHeader><MessageTime>2021-02-17T06:48:29+00:00</MessageTime><MessageReference>MAGE_QUOT_602cbc3d7a42c094065827</MessageReference><SiteID>****</SiteID><Password>****</Password></ServiceHeader><MetaData><SoftwareName>Magento</SoftwareName><SoftwareVersion>2.4.1</SoftwareVersion></MetaData></Request><From><CountryCode>AF</CountryCode><Postalcode>1007</Postalcode><City>Kabul</City></From><BkgDetails><PaymentCountryCode>AF</PaymentCountryCode><Date>2021-02-17</Date><ReadyTime>PT0H00M</ReadyTime><DimensionUnit>CM</DimensionUnit><WeightUnit>KG</WeightUnit><Pieces xmlns=""><Piece xmlns=""><PieceID>1</PieceID><Weight>10.000</Weight></Piece></Pieces><PaymentAccountNumber>966852567</PaymentAccountNumber><IsDutiable>Y</IsDutiable></BkgDetails><To><CountryCode>IN</CountryCode><Postalcode>122102</Postalcode><City>Gurugram</City></To><Dutiable><DeclaredCurrency>USD</DeclaredCurrency><DeclaredValue>100.00</DeclaredValue></Dutiable></GetQuote></req:DCTRequest>
',
  'response' => '<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<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>2021-02-17T06:48:30.433+00:00</MessageTime>
                <MessageReference>MAGE_QUOT_602cbc3d7a42c094065827</MessageReference>
                <SiteID>****</SiteID>
            </ServiceHeader>
        </Response>
        <BkgDetails>
            <QtdShp>
                <OriginServiceArea>
                    <FacilityCode>ACO</FacilityCode>
                    <ServiceAreaCode>KBL</ServiceAreaCode>
                </OriginServiceArea>
                <DestinationServiceArea>
                    <FacilityCode>GUR</FacilityCode>
                    <ServiceAreaCode>DEL</ServiceAreaCode>
                </DestinationServiceArea>
                <GlobalProductCode>P</GlobalProductCode>
                <LocalProductCode>P</LocalProductCode>
                <ProductShortName>EXPRESS WORLDWIDE</ProductShortName>
                <LocalProductName>EXPRESS WORLDWIDE NONDOC</LocalProductName>
                <NetworkTypeCode>TD</NetworkTypeCode>
                <POfferedCustAgreement>N</POfferedCustAgreement>
                <TransInd>Y</TransInd>
                <PickupDate>2021-02-17</PickupDate>
                <PickupCutoffTime>PT11H</PickupCutoffTime>
                <BookingTime>PT11H</BookingTime>
                <ExchangeRate>0.000</ExchangeRate>
                <WeightCharge>0</WeightCharge>
                <WeightChargeTax>0.000</WeightChargeTax>
                <TotalTransitDays>8</TotalTransitDays>
                <PickupPostalLocAddDays>0</PickupPostalLocAddDays>
                <DeliveryPostalLocAddDays>0</DeliveryPostalLocAddDays>
                <PickupNonDHLCourierCode> </PickupNonDHLCourierCode>
                <DeliveryNonDHLCourierCode> </DeliveryNonDHLCourierCode>
                <DeliveryDate>
                    <DeliveryType>QDDC</DeliveryType>
                    <DlvyDateTime>2021-02-25 11:59:00</DlvyDateTime>
                    <DeliveryDateTimeOffset>+00:00</DeliveryDateTimeOffset>
                </DeliveryDate>
                <DeliveryTime>PT23H59M</DeliveryTime>
                <DimensionalWeight>0.000</DimensionalWeight>
                <WeightUnit>LB</WeightUnit>
                <PickupDayOfWeekNum>3</PickupDayOfWeekNum>
                <DestinationDayOfWeekNum>4</DestinationDayOfWeekNum>
                <QuotedWeight>22.000</QuotedWeight>
                <QuotedWeightUOM>LB</QuotedWeightUOM>
                <PricingDate>2021-02-17</PricingDate>
                <ShippingCharge>0.000</ShippingCharge>
                <TotalTaxAmount>0.000</TotalTaxAmount>
                <QtdSInAdCur>
                    <CurrencyRoleTypeCode>BILLC</CurrencyRoleTypeCode>
                    <WeightCharge>0</WeightCharge>
                    <TotalAmount>0.000</TotalAmount>
                    <TotalTaxAmount>0.000</TotalTaxAmount>
                    <WeightChargeTax>0.000</WeightChargeTax>
                </QtdSInAdCur>
                <QtdSInAdCur>
                    <CurrencyCode>EUR</CurrencyCode>
                    <CurrencyRoleTypeCode>PULCL</CurrencyRoleTypeCode>
                    <WeightCharge>0</WeightCharge>
                    <TotalAmount>0.000</TotalAmount>
                    <TotalTaxAmount>0.000</TotalTaxAmount>
                    <WeightChargeTax>0.000</WeightChargeTax>
                </QtdSInAdCur>
                <QtdSInAdCur>
                    <CurrencyCode>EUR</CurrencyCode>
                    <CurrencyRoleTypeCode>BASEC</CurrencyRoleTypeCode>
                    <WeightCharge>0</WeightCharge>
                    <TotalAmount>0.000</TotalAmount>
                    <TotalTaxAmount>0.000</TotalTaxAmount>
                    <WeightChargeTax>0.000</WeightChargeTax>
                </QtdSInAdCur>
                <PickupWindowEarliestTime>00:00:00</PickupWindowEarliestTime>
                <PickupWindowLatestTime>11:00:00</PickupWindowLatestTime>
                <BookingCutoffOffset>PT0S</BookingCutoffOffset>
            </QtdShp>
            <QtdShp>
                <OriginServiceArea>
                    <FacilityCode>ACO</FacilityCode>
                    <ServiceAreaCode>KBL</ServiceAreaCode>
                </OriginServiceArea>
                <DestinationServiceArea>
                    <FacilityCode>GUR</FacilityCode>
                    <ServiceAreaCode>DEL</ServiceAreaCode>
                </DestinationServiceArea>
                <GlobalProductCode>8</GlobalProductCode>
                <LocalProductCode>8</LocalProductCode>
                <ProductShortName>EXPRESS EASY</ProductShortName>
                <LocalProductName>EXPRESS EASY NONDOC</LocalProductName>
                <NetworkTypeCode>TD</NetworkTypeCode>
                <POfferedCustAgreement>Y</POfferedCustAgreement>
                <TransInd>N</TransInd>
                <PickupDate>2021-02-17</PickupDate>
                <PickupCutoffTime>PT11H</PickupCutoffTime>
                <BookingTime>PT11H</BookingTime>
                <ExchangeRate>0.000</ExchangeRate>
                <WeightCharge>0</WeightCharge>
                <WeightChargeTax>0.000</WeightChargeTax>
                <TotalTransitDays>8</TotalTransitDays>
                <PickupPostalLocAddDays>0</PickupPostalLocAddDays>
                <DeliveryPostalLocAddDays>0</DeliveryPostalLocAddDays>
                <PickupNonDHLCourierCode> </PickupNonDHLCourierCode>
                <DeliveryNonDHLCourierCode> </DeliveryNonDHLCourierCode>
                <DeliveryDate>
                    <DeliveryType>QDDC</DeliveryType>
                    <DlvyDateTime>2021-02-25 11:59:00</DlvyDateTime>
                    <DeliveryDateTimeOffset>+00:00</DeliveryDateTimeOffset>
                </DeliveryDate>
                <DeliveryTime>PT23H59M</DeliveryTime>
                <DimensionalWeight>0.000</DimensionalWeight>
                <WeightUnit>LB</WeightUnit>
                <PickupDayOfWeekNum>3</PickupDayOfWeekNum>
                <DestinationDayOfWeekNum>4</DestinationDayOfWeekNum>
                <QuotedWeight>22.000</QuotedWeight>
                <QuotedWeightUOM>LB</QuotedWeightUOM>
                <PricingDate>2021-02-17</PricingDate>
                <ShippingCharge>0.000</ShippingCharge>
                <TotalTaxAmount>0.000</TotalTaxAmount>
                <QtdSInAdCur>
                    <CurrencyRoleTypeCode>BILLC</CurrencyRoleTypeCode>
                    <WeightCharge>0</WeightCharge>
                    <TotalAmount>0.000</TotalAmount>
                    <TotalTaxAmount>0.000</TotalTaxAmount>
                    <WeightChargeTax>0.000</WeightChargeTax>
                </QtdSInAdCur>
                <QtdSInAdCur>
                    <CurrencyCode>EUR</CurrencyCode>
                    <CurrencyRoleTypeCode>PULCL</CurrencyRoleTypeCode>
                    <WeightCharge>0</WeightCharge>
                    <TotalAmount>0.000</TotalAmount>
                    <TotalTaxAmount>0.000</TotalTaxAmount>
                    <WeightChargeTax>0.000</WeightChargeTax>
                </QtdSInAdCur>
                <QtdSInAdCur>
                    <CurrencyCode>EUR</CurrencyCode>
                    <CurrencyRoleTypeCode>BASEC</CurrencyRoleTypeCode>
                    <WeightCharge>0</WeightCharge>
                    <TotalAmount>0.000</TotalAmount>
                    <TotalTaxAmount>0.000</TotalTaxAmount>
                    <WeightChargeTax>0.000</WeightChargeTax>
                </QtdSInAdCur>
                <PickupWindowEarliestTime>00:00:00</PickupWindowEarliestTime>
                <PickupWindowLatestTime>11:00:00</PickupWindowLatestTime>
                <BookingCutoffOffset>PT0S</BookingCutoffOffset>
            </QtdShp>
        </BkgDetails>
        <Srvs>
            <Srv>
                <GlobalProductCode>P</GlobalProductCode>
                <MrkSrv>
                    <LocalProductCode>P</LocalProductCode>
                    <ProductShortName>EXPRESS WORLDWIDE</ProductShortName>
                    <LocalProductName>EXPRESS WORLDWIDE NONDOC</LocalProductName>
                    <ProductDesc>EXPRESS WORLDWIDE NONDOC</ProductDesc>
                    <NetworkTypeCode>TD</NetworkTypeCode>
                    <POfferedCustAgreement>N</POfferedCustAgreement>
                    <TransInd>Y</TransInd>
                    <LocalProductCtryCd>AF</LocalProductCtryCd>
                    <GlobalServiceType>P</GlobalServiceType>
                    <LocalServiceName>EXPRESS WORLDWIDE NONDOC</LocalServiceName>
                </MrkSrv>
            </Srv>
            <Srv>
                <GlobalProductCode>8</GlobalProductCode>
                <MrkSrv>
                    <LocalProductCode>8</LocalProductCode>
                    <ProductShortName>EXPRESS EASY</ProductShortName>
                    <LocalProductName>EXPRESS EASY NONDOC</LocalProductName>
                    <ProductDesc>EXPRESS EASY NONDOC</ProductDesc>
                    <NetworkTypeCode>TD</NetworkTypeCode>
                    <POfferedCustAgreement>Y</POfferedCustAgreement>
                    <TransInd>N</TransInd>
                    <LocalProductCtryCd>AF</LocalProductCtryCd>
                    <GlobalServiceType>8</GlobalServiceType>
                    <LocalServiceName>EXPRESS EASY NONDOC</LocalServiceName>
                </MrkSrv>
            </Srv>
        </Srvs>
        <Note>
            <ActionStatus>Success</ActionStatus>
        </Note>
    </GetQuoteResponse></res:DCTResponse>
<!-- ServiceInvocationId:20210217064830_108e_dbde2ddf-e4a3-4530-ab1e-9bc605b7da6e -->
',
  'from_cache' => false,
) [] []
.
.
.
4
  • What is configuration for DHL shipping in Magento? Is offline Shipping? Check allowed countries for that specific Shipping Method. If Online, maybe You have to manage configuration in DHL account? BTW in screenshot, there is INDIA choosed as country, not Afganistan. Additionally, please check Your configuration for website / store scopes in admin Commented Feb 17, 2021 at 10:33
  • @KonradSiamro The DHL module in Magento 2 fetches DHL shipping methods and rates through APIs on the checkout page, I have credentials from DHL and have configured the module correctly. In order for DHL to provide you shipping methods and rates they will need your shipping origin which I have configured as Afghanistan, they also need a destination address which is collected from the checkout as the customer fills the form in my case that is India and they also need product weight based one which they calculate the rates and my product has weight. Commented Feb 17, 2021 at 10:52
  • The reason I say DHL is configured correctly is that when I change the shipping origin configurations from Afghanistan to the US, I get shipping methods and rates on the checkout page. Now the question may arise that Afghanistan may not be supported by DHL, I have contacted DHL and they said the API credentials work globally and they have even tested it with my credentials and were able to receive rates and methods using their own system. The same way that I receive in the shipping.log file, the problem is that for some reason they are not showing in the checkout. Commented Feb 17, 2021 at 10:57
  • Regrading the allowed countries, I have selected all allowed countries for DHL destination address and according to my configurations, all countries are allowed. I have checked this issue on fresh Magento 2.4.1 installation and I get the same issue. Commented Feb 17, 2021 at 11:00

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.