Skip to main content

cartLinesRemoveDefault

Creates a function that accepts an array of line ids and removes the line items from a cart

Anchor to options
options
required

CartLinesRemoveFunction

export type = ( lineIds: string[], optionalParams?: , ) => Promise<>;
Examples

JavaScript

import {cartLinesRemoveDefault} from '@shopify/hydrogen';

const cartRemove = cartLinesRemoveDefault({
storefront,
getCartId,
});

const result = await cartRemove(['gid://shopify/CartLine/123456789']);
Was this page helpful?