Action functions for cart state
Methods
# inner addToCart(product) → {object}
An action to add product to the cart
Parameters:
| Name | Type | Description |
|---|---|---|
product |
object |
object
# inner loadCartItems(items) → {object}
An action to load user's cart items
Parameters:
| Name | Type | Description |
|---|---|---|
items |
array | cart items |
object
# inner removeProductFromCart(id) → {object}
An action to remove item from cart by id
Parameters:
| Name | Type | Description |
|---|---|---|
id |
string | product id to remove |
object
# inner updateCartInfo(info) → {object}
An action to update general cart info about products added
Parameters:
| Name | Type | Description |
|---|---|---|
info |
object | general cart info like number of items and total price |
object
# inner updateProductInCart(info) → {object}
An action to update product info in the cart
Parameters:
| Name | Type | Description |
|---|---|---|
info |
object | updated product info |
object