convertCurrency
function, since version 2.1.3
categories: currency, converting
convertCurrency(from, targetCurrency)
this function converts input currency amount into different currency, using conversion rate from ps_currency
table.
parameters
- from: currency - currency amount we to convert
- targetCurrency: number - id of currency to convert input value to
return type
currency
examples
convertCurrency(product.basePrice, 2) --- convert base price to EUR currency (id 2)
convertCurrency(toCurrency(100, 1), 2) --- convert value 100 USD (id 1) to EUR (id 2)
convertCurrency(product.basePrice, getCurrencyId(order.currencyId))