Removes line items from the specified checkout.
The removeLineItems()
function returns a Promise that resolves to the updated checkout when the line items are removed from the specified checkout.
function removeLineItems(
_id: string,
lineItemIds: Array<string>,
): Promise<RemoveLineItemsResponse>;
ID of the checkout to remove line items from.
IDs of the line items to be removed.
To find the IDs of the checkout line items you'd like to remove, pass the checkout._id
to getCheckout() and look for the IDs under lineItems
and/or customLineItems
.
import { checkout } from "@wix/ecom";
async function removeLineItems(id, lineItemIds) {
const response = await checkout.removeLineItems(id, lineItemIds);
}
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.