Skip to main content

cartLinesUpdateDefault

Creates a function that accepts an array of CartLineUpdateInput and updates the line items in a cart

Anchor to options
options
required

CartLinesUpdateFunction

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

JavaScript

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

const cartUpdate = cartLinesUpdateDefault({
storefront,
getCartId,
});

const result = await cartUpdate([
{
id: 'gid://shopify/CartLine/123456789',
quantity: 2,
},
]);
Was this page helpful?