Shopify cart and checkout
A client-side cart with add, quantity and remove buttons that hands off to Shopify checkout.
Mark buttons and elements with Shopify roles to build a cart: add to cart, increase, decrease, remove, cart count, subtotal and an item list made from your own item template. Checkout sends the cart lines to Divhunt, which creates a Shopify cart with the Storefront API and redirects the visitor to Shopify's secure checkout.
How it works
- Events shopify:cart:updated, shopify:cart:added.
- Add to cart: [shopify-cart="add"] with shopify-variant-id (required), shopify-product-title, -handle, -image, shopify-variant-title, shopify-product-price, shopify-product-currency, shopify-quantity. Button shows 'Added!' for 1.5 s.
- Cart page: [shopify-cart] items, item-template, empty, subtotal; per item image, title, variant, price, quantity (editable), total; increase/decrease/remove buttons. Prices formatted with Intl.NumberFormat.
- Cart count gets class 'empty' at 0.
- Cart is cleared when the visitor returns from a checkout referrer.
When to use it
- Add to cart on product cards
- A full cart page designed in Divhunt
Limitations
- Max 50 lines and quantity 99 per line; the client does not cap quantity, so above 99 checkout fails with 'Invalid cart.'
- Prices in the cart come from element attributes, Shopify recalculates at checkout
- Cart is per browser (localStorage), not synced across devices
- Cart clears on return from checkout even if the order was not paid
Availability
- Works in Designer.
- Included in every plan.
- Limits: 50 lines, quantity 1-99
How to use it.
- Select a button, Shopify panel > Action > Add to Cart
- Fill Variant ID and other fields with product variables
- Build a cart section with Items Container and Item Template
- Add a Checkout button
Related features.
Shopify integration (headless storefront)
Connect a Shopify store with Storefront API tokens and design product listings and pages in Divhunt.
Shopify drawers: cart, search, quick view
Built-in slide-in cart, product search (Ctrl/Cmd+K) and product quick view drawers for Shopify sites.
Shopify variant picker
Let visitors pick product options (size, color) and update price, image, SKU, stock and the add to cart button.
Browse other features
Designer
Bring your ideas to life with our visual website builder. Drag and drop with ease, or dive into coding when needed.
→AI Studio
Describe it and AI builds it. Every change lands in the same project you can open in the Designer.
→MCP
Connect Claude Code, Cursor or any MCP client and build whole sites with your own agent.
→CMS
Create, organize, and manage your dynamic content with the maximum freedom and flexibility of our visual CMS.
→SEO
Divhunt delivers ultra-fast & structured sites that are good for ranking by default, while offering complete control for customization.
→REST API
Easily link to any REST API endpoint with instant preview and expand your site’s functionality smoother than ever before.
→Plugins
Divhunt offers an open platform for creating plugins to upgrade features, add new capabilities, and simplify building better sites.
→Localization
Localize everything from static pages and CMS content to URLs and metadata, in up to 15 languages with no add-on.
→Interactions
Visually create animations and interactions with a simple, intuitive timeline. Build smooth, engaging experiences without code.
→Custom Files
Manage JS and CSS files with a structure developers love, combining folders and clean organization.
→Memberships
Create plans, decide who sees what and connect it all to your CMS. Build courses, communities or client portals.
→