Shipping message wrong

Shipping message wrong

lxurnz_
Excursionist
15 0 3

Cheers Everyone, 

I'm having this weird issue, where the in-cart message about how much is needed for free shipping is off. 

When in the Swedish market, it works perfectly fine. 
But switching to the German market the message is off. And that by a lot. 

Free shipping is eligible on an order value of 340kr SEK or 34€. When adding a bundle worth 340kr/34€ in the Swedish market it shows eligibility for free shipping. On the German market it says 290€ needed for free shipping. 
If in the German market you go to checkout and enter a German address is shows Free shipping. 

Shipping rates are set the same for all Swedish and EU market. 

This tells me that it is either an issue in translation or currency change. Or something else?! I have no clue why it does that. 

Please feel free to check out my store and test for yourself: 

amoandoak.se


Appreciate any input on this!

Hälsa
Laurenz
Replies 6 (6)

mageplaza-cs
Shopify Partner
494 42 82

Hi @lxurnz_ 

I have checked your checkout page with the above cases. However, the issue 'Shipping message wrong' did not occur. Could you please provide a more detailed description or attach a screenshot to better illustrate your case?

Mageplaza | Top-Rated Shopify Agency | Trusted by 230,000+ worldwide merchants


If our suggestion works for you, please give it a Like or mark it as a Solution!


Should you have any questions or concerns, feel free to contact us via consultant@mageplaza.com

tim
Shopify Partner
4481 532 1634

It looks like the threshold for Free Shipping is always passed to the frontend in base currency. So if it's 280 Sek, it's processed on the frontend as 280 Euro, so if your cart is 40Euro, the difference would still be shown as 240, even though 40 Euro > 280 Sek.

 

This can be fixed in theme Javascript code, however, I've first try to contact theme developers.

Can't really suggest the JS code edit as I do not have access to the theme code.

Here is the idea -- there is this function in assets/theme.js

 get totalPrice() {
    return parseFloat(this.getAttribute("total-price"))
  }

I'd try to modify it like this:

 get totalPrice() {
    return parseFloat(this.getAttribute("total-price")) * Shopify.currency.rate
  }

This will take in account currency exchange rate for selected currency.

If my post is helpful, hit the thumb up button -- it will help others with similar problem to find a solution.
I can be reached via e-mail tairli@yahoo.com
lxurnz_
Excursionist
15 0 3

Hey, thanks for the advice, sadly the change in code didn't change. 

Have you got another idea how to fix this? 

I might also reach out so the developers. 


Hälsa
Laurenz
tim
Shopify Partner
4481 532 1634

Yes, I guess that was a wrong approach -- one needs to convert the threshold to current currency, rather than the other way around....

So, yes, I do have other ideas!

try editing

__privateSet(this, _threshold, parseFloat(this.getAttribute("threshold").replace(/[^0-9.]/g, "")) * 100);
this.setAttribute("threshold", __privateGet(this, _threshold));

to 

__privateSet(this, _threshold, parseFloat(this.getAttribute("threshold").replace(/[^0-9.]/g, "")) * 100  * Shopify.currency.rate);

I expect this to produce proper results.

If my post is helpful, hit the thumb up button -- it will help others with similar problem to find a solution.
I can be reached via e-mail tairli@yahoo.com
lxurnz_
Excursionist
15 0 3

Hej mate, 

this seems to have fixed the currency conversion. Though the entire free shipping threshold is off. It is set at 450kr or 45€. On the cart it is on 280kr or 26 something Euros. 

This might be a whole different issue, but would you have an idea on how to fix that? 😅

Hälsa
Laurenz
tim
Shopify Partner
4481 532 1634

Yes, from my point of view I see:

<free-shipping-bar class="free-shipping-bar" threshold="280" ...>

 

Can't tell why without looking at the theme code, because it's output by Liquid code which is not visible from the outside...

 

If my post is helpful, hit the thumb up button -- it will help others with similar problem to find a solution.
I can be reached via e-mail tairli@yahoo.com