Incorrect discount calculation when converting currencies
complete
Tobe Osakwe
We have recently identified an issue in Shopify itself that has led to international customers receiving higher discounts than they are eligible to from our app.
The cause is that Shopify is actually using a different rate to convert prices to local currencies, than is provided by the Shopify Geolocation app.
For example, one of our customers has a product available for $54 USD, and 2 shipping discounts: $10 off shipping for orders over $150 USD, and $20 off shipping for orders over $250 USD.
The currency conversion rate the Geolocation app provides from USD to CAD when I tested was 1.3788166. This is also the currency conversion rate provided to Regios Discounts.
However, in the cart and checkout, the price of the $54 USD is converted to $81 CAD by Shopify. This implies a ratio of 1.5, which is a major difference from the rate we are given.
As you can imagine, this is a significant difference in ratio, and leads to incorrect calculations. Our app only receives the CAD prices and 1.3788166 rate from Shopify when trying to calculate discounts - there's no way for us to get the prices in USD without calculating it ourselves.
To convert prices back to USD, so that we can test against your minimum/maximum purchase requirements/etc., our app's code divides the subtotal of $363 CAD shown in the attached screenshot by the 1.3788166 rate. This leads to the subtotal being calculated as $263.27 USD, which is why the "$20 off shipping for orders over $250 USD" is applying, when in reality, the cart subtotal was $242 USD. Instead, the $10 off discount should have applied.
We're reaching out to Shopify to get to the bottom of what exactly is going on here, but it may take time to receive a response from them.
If you are experiencing this or a similar issue, please upvote and comment on this thread, so that you can receive future updates automatically.
Photo Viewer
View photos in a modal
Tobe Osakwe
updated the status to
complete
Tobe Osakwe
Shopify support has identified the cause of this issue.
It turns out it is not an issue with either Shopify Functions, or our app.
In this case, the inconsistent conversion was caused by how the store had set up Shopify Markets. Here's what Shopify support told us:
"I spoke to our escalated teams and they passed along that, (link to marketing pricing in store) - you have a price increase for Canada as well as rounding rules, this behaviour is expected If you don’t want it to be more expensive take the price increase off."
Tobe Osakwe
We have reached out again to Shopify support about this issue, this time through the Shopify Partners support portal.
I'm hoping they will respond within a few days.
We will keep you updated on what they say.
Best,
Tobe