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

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))

Related functions:

Update your privacy settings