Members
Methods
# getCartSum(cart) → {number}
Gets the sum of cart items
Parameters:
| Name | Type | Description |
|---|---|---|
cart |
array | user's cart items |
Sum of cart items
number
# getNumberOfCartItems(cart) → {number}
Gets the number of cart items
Parameters:
| Name | Type | Description |
|---|---|---|
cart |
userIdStorageKey | user's cart items |
Number of cart items
number
# getPriceToFixed(price, limit) → {string}
Normalizes the product's price
Parameters:
| Name | Type | Description |
|---|---|---|
price |
number | product's price |
limit |
number | limit of characters to shorten the price |
updated product's price
string
# validateImgUrl(url) → {boolean}
Validates value to be a url image
Parameters:
| Name | Type | Description |
|---|---|---|
url |
string | a url to check |
boolean
# validateMinLength(value, number) → {boolean}
Validates value to be more than min length set
Parameters:
| Name | Type | Description |
|---|---|---|
value |
string | a value to check |
number |
minLength | min length |
boolean
# validateNotEmptyText(text) → {boolean}
Validates value to be not empty
Parameters:
| Name | Type | Description |
|---|---|---|
text |
string | a text to check |
boolean
# validateNumber(number) → {boolean}
Validates value to be a number
Parameters:
| Name | Type | Description |
|---|---|---|
number |
number | a number to check |
boolean