Skip to main content
Checkout Button preview Sends the shopper’s cart to Shopify and opens Shopify’s checkout. Works as a ready-styled button, or wraps any element you design.

What It Does

  • Creates a Shopify cart — on click, reads the cart from localStorage and sends it to Shopify with a cartCreate request.
  • Opens Shopify checkout — goes to the checkout page in the same tab, so the shopper’s back button returns to your store.
  • Clears the cart after the order — it remembers the Shopify cart it created. When the shopper comes back after paying, the Cart Item Counter removes the bought items. If they leave checkout without paying, the cart stays.
  • Empty cart message — clicking with an empty cart shows Empty Cart Label instead of going anywhere.
  • Your own design or the built-in button — put any element in the Children slot and it becomes the button. Leave the slot empty to use the built-in button styled by the controls below.

Property Controls

Store

Content

Built-in button style

Used only when Children is empty.

Notes

  • The cart must be in localStorage under the key cart, as written by the Add to Cart Button.
  • Use the Storefront API public access token from Shopify’s Headless channel. Never paste a private token: anything on a published site is visible to shoppers.
  • If Shopify rejects the cart (for example a deleted variant), the button shows “Checkout failed” and stays on the page. Details are in the browser console.