Deprecated.
This function will continue to work, but a newer version is available at
wix-ecom-backend.currentCart.removeLineItemsFromCurrentCart()
.
If this function is already in your code, it will continue to work.
To stay compatible with future changes, migrate to
wix-ecom-backend.currentCart.removeLineItemsFromCurrentCart()
.
To migrate to the new function:
Add the new import statement:
Look for any code that uses cart.removeProduct()
,
and replace it with currentCart.removeLineItemsFromCurrentCart()
.
Update your code to work with the new currentCart.removeLineItemsFromCurrentCart()
call and response properties.
Test your changes to make sure your code behaves as expected.
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.removeProduct()
will only work when viewing the live site.
ID of the cart line item to remove.