removeProduct( )


Removes a specified product from the cart.

The removeProduct() function returns a Promise that resolves to the updated cart after the product is removed. Every line item in a cart has an ID. Pass this to removeProduct() to remove that line item/product from the cart.

Notes:

  • removeProduct() does not decrement the line item's quantity, it removes the line item/product altogether.
  • When editing a site as a contributor, removeProduct() will only work when viewing the live site.
Method Declaration
Copy
Method Parameters
cartLineItemIdnumberRequired

ID of the cart line item to remove.

Returns
Return Type:Promise<CartObj>
Was this helpful?
Yes
No