Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Re: Checkout UI Extensions Currency Conversion

Checkout UI Extensions Currency Conversion

mattdenoronha
Shopify Partner
35 1 15

There doesn't seem to be a way to convert currencies within a checkout extension.

 

For one example, we have a free shipping bar that's completed at 200 GBP. If the cart total is 200 GBP or over, the success message shows.

 

How can this be done when the cart total is X USD. There is no way to convert the 200 GBP to USD, or to get the cart total is GBP.

 

Is there no solution to achieve this?

 

 

Replies 8 (8)

Liam
Community Manager
3108 344 904

Hi Mattdenoronha,

 

Have you explored potentially creating different rules for each available currency on the store (which could be dynamically updated based on current exchange rates) and then conditionally rendering the shipping bar based on the cart's currency?

Liam | Developer Advocate @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

mattdenoronha
Shopify Partner
35 1 15

Thanks for your reply @Liam .

 

How would we dynamically update from the current exchange rate, as far as I can see from the documentation, exchange rate isn't accessible in a checkout UI extension?

 

We could set the rule to appear based on a set USD value, but the threshold is in GBP, so that USD value will be wrong when the currency conversion changes. 

 

It seems possible, as some public apps are doing it.

 

adkhamllama
Shopify Partner
27 1 50

Hi @Liam 
I have similar issues with currency rules. We have custom rules, so merchant can trigger "some action" when cart subtotal is greater than $1000 USD.
When user comes from Mexico market, product prices are much higher.
I don't think merchants will like to duplicate the rules for different currencies.
On theme we have window.Shopify.currency.rate to handle such price validations, but not in checkout.
Can you please contact the API team and discuss such feature? It is really needed for multi-currency checkout.

Liam
Community Manager
3108 344 904

Hi Adkhamllama - as you noted there's no access to `window` within checkout extensions, but I've raised this usecase with the extensions product team. 

Liam | Developer Advocate @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

adkhamllama
Shopify Partner
27 1 50

Thank you @Liam
Waiting for updates.

mattdenoronha
Shopify Partner
35 1 15

Hi @Liam, any updates yet?

DevLanternSol
Shopify Partner
1 0 0

Hey @mattdenoronha , did you ever find a solution?
I'm currently tempted to use a currency exchange API but wondering if there's a better way.

mattdenoronha
Shopify Partner
35 1 15

I'll include the solution that was provided to us by the Shopify Community on Slack. We haven't tried it yet, however.

 

To handle currency conversion for checkout UI extensions, you can consider using Shopify's currency converter. Start by creating a shop metafield or metaobject that is typed in money. Then, when you access the field in the extension, the returned value will be converted to the current currency being shown to customers.