Skip to main content

Helpers

View source code

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

ParamTypeDescription
currencySymbolStringcurrencySymbol = symbol or code of currency
currencyPositionLeftBooleancurrencyPositionLeft = whether the symbol is located left to the number
decimalPlacesNumberdecimalPlaces = number of decimal places
decimalSeparatorStringdecimalSeparator = separator of decimals
thousandSeparatorStringthousandSeparator = 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

ParamTypeDescription
elObjectel = input field that have to be updated
minNumberdecimals = minimum allowed amount
maxNumbermax = maximum allowed amount
decimalsNumberdecimals = allowed decimal places
action'increase' | 'decrease'accepts 'increase' or 'decrease' action = accepts 'increase' or 'decrease'
callbackfunctioncallback = 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

ParamTypeDescription
valuenumbercurrent value
minnumberminimum allowed amount
decimalsnumberallowed decimal places
action'increase' | 'decrease'accepts 'increase' or 'decrease'