cartService lets you read and change the cart.
Use it when your extension needs to inspect cart items, add an item, update quantities, or remove an item.
Global Name
API
Methods
getCartItemsCount
Returns the number of line items in the cart.getLineItems
Returns the current cart line items.addLineItem
Adds a product variant to the cart.true when the item was added.