What can JSMA carts do for me?The JSMA carts provides access to the current cart (JSMA cart) of the session and allows to reset it. |
The JSMA carts provides the following methods:
Returns the current cart (JSMA cart). Will create a cart object if none was created before internally.
CartApi.prototype.doDecrementItemQuantity = function () { var itemId = request.parameter("itemId"); [...] if (quantity <= 0) { carts.current.removeItem(itemId); } [...] }; |
Connects a cart (specified by uuid) to the current session.
... carts.pickup("CART_UUID"); ... |
A string containing the uuid of a cart.
Retrieves a cart (specified by uuid) and returns it as a JSMA cart.
... carts.findByUuid(uuid) // => JSMA cart ... |
A string containing the uuid of a cart.
Resets the current cart. This method is called after an order has processed successfully.
... carts.resetCurrentCart() ... |