• Resolved Diego

    (@daigo75)


    Based on the change log, the ShipStation plugin sends the currency together with the order data. However, this is done by calling the wrong function.

    In file class-wc-shipstation-api-export.php, method WC_Shipstation_API_Export::request() contains the following line:

    $this->xml_append( $order_xml, 'CurrencyCode', get_woocommerce_currency(), false );

    Function get_woocommerce_currency() returns the active currency, which may or may not be the same as the order currency. The call should be replaced with the following:
    $this->xml_append( $order_xml, 'CurrencyCode', $order->get_currency(), false );

    Note
    We received reports that ShipStation might not be able to process orders in multiple currencies. Interestingly, their service kind of worked anyway with such systems, because the order currency was not passed with the data. Based on our tests, it seems that, when orders were sent in different currencies, ShipStation assumed (incorrectly) that they were in the currency set for their client’s account, and carried on.

    We can’t say if that resulted in errors on ShipStation’s side, but it’s worth keeping this in mind, in case the owner of multi-currency shop encounters any issue.

    Further improvements
    It could be a good idea to introduce a filter while fetching the order to pass to ShipStation. That is, replacing:
    $order = wc_get_order( $order_id );
    With something like:
    $order = apply_filters( 'woocommerce_shipstation_export_order', wc_get_order( $order_id ) );

    That will allow 3rd parties to intercept the order before its contents are send to ShipStation. This can come in handy, for example, when ShipStation expects data in a specific currency, but the order is in another (again, common in multi-currency sites).

    Frankly, it’s surprising that such services still don’t include native multi-currency support, but, if they are going to stay like that, at least the filter can allow the integration to send them the data they expect.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Niall a11n

    (@wpniall)

    Hi @daigo75,

    Thank you for embracing the spirt of open-soure software by providing this detailed bug report for the latest 4.1.41 version of WooCommerce ShipStation Integration. I’ve reported this issue to our developers for further investigation.

    Thread Starter Diego

    (@daigo75)

    I don’t think that the issue needs much of an investigation, as it’s a very basic fix, but thanks for the update.

    Plugin Support Adam Heckler

    (@adamkheckler)

    I don’t think that the issue needs much of an investigation, as it’s a very basic fix

    Indeed, our devs already have a fix proposed and ready to merge into the codebase for this issue. Keep an eye on the ShipStation changelog for version 4.1.42, which should contain this fix. I don’t have an exact timeline on that though.

    Thanks for the report again!

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

The topic ‘Small bug – Wrong currency in exported data’ is closed to new replies.