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: How to retrieve the presentmentCurrencyRate value from outside the function

How to retrieve the presentmentCurrencyRate value from outside the function

DanteFXX
Shopify Partner
15 2 9

I'm sorry, guys, I know my question is only indirectly related to the discount function. But has anyone solved such an issue - how to obtain the value of presentmentCurrencyRate outside of the discount function (from type Input) in Liquid or through the API, to correctly display the expected discount in the local currency on the page?

Reply 1 (1)

Liam
Community Manager
3108 344 899

You could try using the Storefront API to fetch product prices in the presentment currency - once you have the product's original price and the presentment currency price, you can calculate the rate by dividing the presentment currency price by the original price.

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