Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter micketeeling

    (@micketeeling)

    Hi again,
    After some hacking around, it looks like you have to loop over the items in “QtdSInAdCur” in the xml response. An ugly hack that works for me is to add the following to set the rate cost, on line 384 in “a2z_dhlexpress_init.php”:

    foreach ($quote->QtdSInAdCur as $myCurrBlock) {
        $theCurr = (float)((string) $myCurrBlock->CurrencyCode);
        if($theCurr == 'EUR'){
            $rate_cost = (float)((string) $myCurrBlock->TotalAmount);
        }
    }
    Thread Starter micketeeling

    (@micketeeling)

    Thanks for your reply!
    It does not seem to do the exchange though. My stores currency is EUR, below is the response I get from DHL through the plugin. In the store frontend I get the value €368.62, but that would be the SEK value. The correct value would be €35.55, which is included in the response from DHL under the [2] item (marked with currency code EUR):

    [3] => SimpleXMLElement Object
    (
    [GlobalProductCode] => P
    [LocalProductCode] => S
    [ProductShortName] => EXPRESS WORLDWIDE
    [LocalProductName] => EXPRESS WORLDWIDE NONDOC
    [NetworkTypeCode] => TD
    [POfferedCustAgreement] => N
    [TransInd] => Y
    [PickupDate] => 2019-02-06
    [PickupCutoffTime] => PT19H15M
    [BookingTime] => PT18H15M
    [CurrencyCode] => SEK
    [ExchangeRate] => 0.096428
    [WeightCharge] => 314.390
    [WeightChargeTax] => 0.000
    [TotalTransitDays] => 2
    [PickupPostalLocAddDays] => 0
    [DeliveryPostalLocAddDays] => 0
    [PickupNonDHLCourierCode] => SimpleXMLElement Object
    (
    [0] =>
    )

    [DeliveryNonDHLCourierCode] => SimpleXMLElement Object
    (
    [0] =>
    )

    [DeliveryDate] => 2019-02-08
    [DeliveryTime] => PT23H59M
    [DimensionalWeight] => 2.000
    [WeightUnit] => KG
    [PickupDayOfWeekNum] => 3
    [DestinationDayOfWeekNum] => 5
    [QtdShpExChrg] => SimpleXMLElement Object
    (
    [SpecialServiceType] => FF
    [LocalServiceType] => FF
    [GlobalServiceName] => FUEL SURCHARGE
    [LocalServiceTypeName] => FUEL SURCHARGE
    [SOfferedCustAgreement] => N
    [ChargeCodeType] => SCH
    [CurrencyCode] => SEK
    [ChargeValue] => 54.230
    [ChargeTaxAmount] => 0.000
    [ChargeTaxAmountDet] => SimpleXMLElement Object
    (
    [TaxTypeRate] => 0.000
    [TaxTypeCode] => All Bu
    [TaxAmount] => 0.000
    [BaseAmount] => 54.230
    )

    [QtdSExtrChrgInAdCur] => Array
    (
    [0] => SimpleXMLElement Object
    (
    [ChargeValue] => 54.230
    [ChargeTaxAmount] => 0.000
    [CurrencyCode] => SEK
    [CurrencyRoleTypeCode] => BILLC
    [ChargeTaxAmountDet] => SimpleXMLElement Object
    (
    [TaxTypeRate] => 0.000
    [TaxTypeCode] => All Bu
    [TaxAmount] => 0.000
    [BaseAmount] => 54.230
    )

    )

    [1] => SimpleXMLElement Object
    (
    [ChargeValue] => 54.230
    [ChargeTaxAmount] => 0.000
    [CurrencyCode] => SEK
    [CurrencyRoleTypeCode] => PULCL
    [ChargeTaxAmountDet] => SimpleXMLElement Object
    (
    [TaxTypeRate] => 0.000
    [TaxTypeCode] => All Bu
    [TaxAmount] => 0.000
    [BaseAmount] => 54.230
    )

    )

    [2] => SimpleXMLElement Object
    (
    [ChargeValue] => 5.230
    [ChargeTaxRate] => 0.000
    [ChargeTaxAmount] => 0.000
    [CurrencyCode] => EUR
    [CurrencyRoleTypeCode] => BASEC
    [ChargeTaxAmountDet] => SimpleXMLElement Object
    (
    [TaxTypeRate] => 0.000
    [TaxTypeCode] => All Bu
    [TaxAmount] => 0.000
    [BaseAmount] => 5.230
    )

    )

    )

    )

    [PricingDate] => 2019-02-06
    [ShippingCharge] => 368.620
    [TotalTaxAmount] => 0.000
    [QtdSInAdCur] => Array
    (
    [0] => SimpleXMLElement Object
    (
    [CurrencyCode] => SEK
    [CurrencyRoleTypeCode] => BILLC
    [WeightCharge] => 314.390
    [TotalAmount] => 368.620
    [TotalTaxAmount] => 0.000
    [WeightChargeTax] => 0.000
    [WeightChargeTaxDet] => SimpleXMLElement Object
    (
    [TaxTypeRate] => 0.000
    [TaxTypeCode] => All Bu
    [WeightChargeTax] => 0.000
    [BaseAmt] => 314.390
    )

    )

    [1] => SimpleXMLElement Object
    (
    [CurrencyCode] => SEK
    [CurrencyRoleTypeCode] => PULCL
    [WeightCharge] => 314.390
    [TotalAmount] => 368.620
    [TotalTaxAmount] => 0.000
    [WeightChargeTax] => 0.000
    [WeightChargeTaxDet] => SimpleXMLElement Object
    (
    [TaxTypeRate] => 0.000
    [TaxTypeCode] => All Bu
    [WeightChargeTax] => 0.000
    [BaseAmt] => 314.390
    )

    )

    [2] => SimpleXMLElement Object
    (
    [ExchangeRate] => 0.096428
    [CurrencyCode] => EUR
    [CurrencyRoleTypeCode] => BASEC
    [WeightCharge] => 30.320
    [TotalAmount] => 35.550
    [TotalTaxAmount] => 0.000
    [WeightChargeTax] => 0.000
    [WeightChargeTaxDet] => SimpleXMLElement Object
    (
    [TaxTypeRate] => 0.000
    [TaxTypeCode] => All Bu
    [WeightChargeTax] => 0.000
    [BaseAmt] => 30.320
    )

    )

    )

    [WeightChargeTaxDet] => SimpleXMLElement Object
    (
    [TaxTypeRate] => 0.000
    [TaxTypeCode] => All Bu
    [WeightChargeTax] => 0.000
    [BaseAmt] => 314.390
    )

    )

Viewing 2 replies - 1 through 2 (of 2 total)