Hey there,
I know we can access current storefront currency rate with Shopify.currency.rate
but is there a way to access it from Liquid?
Thanks for your help
Hey there,
I know we can access current storefront currency rate with Shopify.currency.rate
but is there a way to access it from Liquid?
Thanks for your help
You could store them in cart attributes and remove them when you no longer need to use them.
there is a liquid drop for currency â does this work for your use case?
Yeah you can get that on first page load then throw it into cart attributes and then use it in Liquid via the Section Rendering API, or pulling the page again and replacing the view, etc.
You just cannot get it on initial load via Liquid because itâs not there.
Just remember to remove from cart attributes when you no longer need to use it or it will show in the order page of the admin back-end.
Mhh I donât need all of that, I can just use JS instead but I wanted a straight solution using Liquid but maybe thereâs none
If something from the team is around, could be good to have that in the future
Makes sense to go that route. Usually people want it in Liquid to process things outside of the client-side so that is why I shared some suggestions on what to do to make that happen.
Liquid needs to be predictable so that is why randomness is not part of it. With exchange rates, I am guessing the same restriction applies so we likely will not see them natively in Liquid.