The currency is set in the “General Client Settings” tab of the Smarty control panel; by default it is RUB. The currency selected in this field is displayed in customer applications and is also used in payment gateways. It is also possible to redefine the currency for a specific customer on their editing page.
The list of available currencies can be expanded using the Smarty configuration file. The newly added currency must be assigned an index (indexation starts from 100) in the CURRENCY_SETTINGS_INDEX_<ISO-currency code> format. Next up, this index must be added to the list of available currencies using the CURRENCY_SETTINGS_DATA parameter (below is an example of adding the Belarusian ruble):
CURRENCY_SETTINGS_INDEX_BYN = 100
CURRENCY_SETTINGS_DATA[CURRENCY_SETTINGS_INDEX_BYN] = {
‘name’: ‘BYN’,
}
In order for a currency to be supported in a payment gateway, it is necessary to configure its index (the currency index is different within each payment gateway, usually it can be found in its documentation).
CURRENCY_SETTINGS_INDEX_BYN = 100
CURRENCY_SETTINGS_DATA[CURRENCY_SETTINGS_INDEX_BYN] = {
‘name’: ‘BYN’,
‘paypal_code’: ‘BYN’,
‘paymaster_code’: ‘BYN’,
‘squareup_code’: ‘BYN’,
‘payture_code’: »,
‘null’: »,
‘ISO’: ‘BYN’,
‘is_zero_decimal’: False,
}
List of default currencies in Smarty:
- RUB
- EUR
- USD
- AMD
- KGS
- KZT