Documentation IndexFetch the complete documentation index at: /llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Remove items from the cart
openbridge.cart.remove(lineId) openbridge.cart.remove(lineIds)
lineId
string
lineIds
string[]
Promise<
ShopifyCart
>
const lines = openbridge.cart.lines() await openbridge.cart.remove(lines[0].id)
const lines = openbridge.cart.lines() const idsToRemove = lines.slice(0, 2).map((l) => l.id) await openbridge.cart.remove(idsToRemove)
document.querySelectorAll('.remove-item').forEach((button) => { button.addEventListener('click', async () => { const lineId = button.dataset.lineId await openbridge.cart.remove(lineId) }) })
const productHandle = 'awesome-tshirt' const lines = openbridge.cart.lines() const linesToRemove = lines .filter((line) => line.merchandise.product.handle === productHandle) .map((line) => line.id) if (linesToRemove.length > 0) { await openbridge.cart.remove(linesToRemove) }
.clear()