How to retrieve the presentmentCurrencyRate value from outside the function

DanteFXX
Shopify Partner
14 2 6

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
Shopify Staff
2731 302 777

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