cart/remove
Remove products to your cart
Fields
lineItems
• [ lineItems ]required
lineItems
• [ lineItems ]requiredAn array of lineItem
objects to be added to cart
lineItem
objects to be added to cartLineItems Fields
variantId
• string required
variantId
• string requiredThe Shopify ID of the variant to remove
quantity
• number
quantity
• numberHow many to remove from cart. If value is left null it will remove all quantity of the variant from cart
Adds one or more products to the shopping cart. This action handles cart creation if no cart exists, processes line items with proper validation, and updates the cart state.
Basic usage - Removing all quantities of a line item
Tapcart.action("cart/remove", {
lineItems: [
{
variantId: "gid://shopify/ProductVariant/12345678"
// No quantity = remove completely
}
]
});
Basic usage - Removing 1 quantity from a line item
Tapcart.action("cart/remove", {
lineItems: [
{
variantId: "gid://shopify/ProductVariant/12345678"
// No quantity = remove completely
}
]
});
Updated 9 days ago