updateLineItemsQuantity( )


Updates the quantity of one or more line items in a specified cart.

After a cart is updated, call refreshCart() to update the cart's UI elements and trigger the onCartChange() event.

This method is only for updating the quantity of line items. To entirely remove a line item from the cart, use removeLineItems(). To add a new line item to the cart, use addToCart().

This method checks the amount of stock remaining for this line item. If the specified quantity is greater than the remaining stock, then the quantity returned in the response is the total amount of remaining stock.

Permissions
Manage eCommerce - all permissions
Manage Stores - all permissions
Manage Restaurants - all permissions
Learn more about app permissions.
Method Declaration
Copy
Method Parameters
_idstringRequired

Cart ID.


lineItemsArray<LineItemQuantityUpdate>Required

Line item IDs and their new quantity.

Returns
Return Type:Promise<UpdateLineItemsQuantityResponse>

The first line item is updated to a quantity of 2, while the second is updated to a quantity of 3

JavaScript
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?