Discussing Shopify Functions development, deployment, and usage in Shopify apps.
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?
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