Skip to main content

openCart

Shows the cart to the buyer. The storefront decides whether that means opening a drawer or navigating to the cart page.

You can use this after adding an item, so the buyer sees what happened without your app needing to know how the cart is presented.

It takes no arguments and resolves with nothing. Without a configuration, it opens a cart drawer it recognizes, and navigates to /cart when it finds none.

Shows the cart to the buyer. The storefront decides whether that means opening a drawer or navigating to the cart page.

Promise<void>
Examples

Call the action

await Shopify.actions.updateCart({
lines: [{ merchandiseId: variantId, quantity: 1 }],
});

await Shopify.actions.openCart();

Was this page helpful?