• Resolved micketeeling

    (@micketeeling)


    Hi,
    I have a store based in Sweden, but the currency used in woo is euro. When I get the rated from the plugin it looks like they’re in Swedish SEK, but they’re being used as EUR in the store. Is there a way around that?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Contributor a2zplugins

    (@a2zplugins)

    Our Plugin is convert the rates based on DHL currency and Store currency

    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
    )

    )

    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);
        }
    }
    Plugin Contributor a2zplugins

    (@a2zplugins)

    Hi,

    Ok. Thank you. You can use now. For more support contact us. We are happy to help you

    can we have an update with the working currency conversion

    your website is now just affiliate collections of other peoples stuff

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Currency of rates in the store frontend?’ is closed to new replies.