Helpers
danger
This template is WIP
formatAsCurrency(currencySymbol, currencyPositionLeft, decimalPlaces, decimalSeparator, thousandSeparator)
Format currency the same way as on backend If you omit all arguments, default values of currency will be used
Kind: global function
Param | Type | Description |
---|---|---|
currencySymbol | String | currencySymbol = symbol or code of currency |
currencyPositionLeft | Boolean | currencyPositionLeft = whether the symbol is located left to the number |
decimalPlaces | Number | decimalPlaces = number of decimal places |
decimalSeparator | String | decimalSeparator = separator of decimals |
thousandSeparator | String | thousandSeparator = separator of thousands |
updateQuantity(el, min, max, decimals, action, callback)
Increase/decrease quantity of products in input by clickin' on arrows Decimals, min and max values are passed by data-attributes
Kind: global function
Param | Type | Description |
---|---|---|
el | Object | el = input field that have to be updated |
min | Number | decimals = minimum allowed amount |
max | Number | max = maximum allowed amount |
decimals | Number | decimals = allowed decimal places |
action | 'increase' | 'decrease' | accepts 'increase' or 'decrease' action = accepts 'increase' or 'decrease' |
callback | function | callback = optional callback after quantity update |
updateQuantityInner(value, min, decimals, action) ⇒ number
Increase/decrease quantity of products in input
Kind: global function
Returns: number
- - new value
Param | Type | Description |
---|---|---|
value | number | current value |
min | number | minimum allowed amount |
decimals | number | allowed decimal places |
action | 'increase' | 'decrease' | accepts 'increase' or 'decrease' |