cart-logic
Cart Logic guides you through implementing core cart functionality—adding, removing, and updating items—on your platform of choice. It covers built-in cart configuration for Shopify, WooCommerce, and BigCommerce, plus custom implementations for headless storefronts using Storefront APIs. Learn to persist carts across sessions and devices, merge guest carts when customers log in, and optimize key UX behaviors that drive conversion.
Cart Logic helps you build or configure a shopping cart with add, remove, and update operations across Shopify, WooCommerce, BigCommerce, and custom storefronts.
AI-generated summary based on this skill's SKILL.md
Install
finsilabs/awesome-ecommerce-skills/cart-logic · repository language: JavaScript
git clone https://github.com/finsilabs/awesome-ecommerce-skills
cp -r awesome-ecommerce-skills/skills/payments-checkout/cart-logic ~/.claude/skills/cart-logicFrequently asked questions
AI-generated answers based on this skill's SKILL.md and metadata
How to build shopping cart add remove update functionality?
Cart Logic provides step-by-step guidance for implementing core cart operations across multiple platforms. For Shopify, WooCommerce, and BigCommerce, you'll learn built-in configuration methods. For custom or headless storefronts, Cart Logic covers Storefront API integration patterns that let you add items to cart, remove line items, and update quantities programmatically. Each approach includes code examples and best practices for reliable state management.
How do I keep cart items after page reload?
Cart Logic covers cart persistence strategies to maintain items across page loads and devices. The skill explains session storage, local storage, and server-side persistence techniques so your customers' carts survive navigation, browser refresh, and device switching. You'll learn which persistence method works best for your architecture—whether you're using a platform's native cart or building a custom implementation with API integration.
How does cart-logic handle merging guest carts when users log in?
Cart Logic teaches the merge logic required when a guest customer creates a cart, then later registers or logs in. The skill covers identifying guest and registered user carts, combining line items without duplication, and syncing the merged state back to your platform. You'll find patterns for Shopify, WooCommerce, BigCommerce, and headless implementations using Storefront APIs.
Can I use cart-logic for a headless or custom storefront?
Yes. Cart Logic is designed for headless and custom storefronts using Storefront APIs. The skill walks through API-driven cart operations, state management without a built-in admin interface, and best practices for building a robust ecommerce cart system from scratch. You'll learn how to handle line items, persistence, guest-to-registered merges, and multi-device synchronization in your custom frontend.
What should I do if cart state is lost on navigation?
Cart Logic includes troubleshooting guidance for cart data loss and session management issues. The skill explains common causes—missing persistence configuration, session timeout, or API sync failures—and provides fixes for each platform. You'll learn recovery strategies, proper session storage setup, and how to validate cart state across page transitions to prevent abandonment.
Is cart-logic available under an open-source license?
Cart Logic is released under the MIT license, making it free to use, modify, and distribute in both open-source and commercial projects with minimal restrictions.
SKILL.md
rendered from the published skill — quoted content, verbatim
Cart Logic
Overview
Cart logic covers how your store manages items a shopper intends to buy: adding, removing, and updating items; persisting the cart across page loads and devices; and merging a guest cart into an account when the customer logs in. On Shopify, WooCommerce, and BigCommerce, the cart is built into the platform — the goal is to configure it correctly and extend it when needed. Custom code is only required for headless storefronts.
When to Use This Skill
- When cart state is lost when users navigate between pages (missing
(truncated - see the full file via the links below)
Read as markdown · JSON record · Browse the source repository
File tree — 8 files
skills/payments-checkout/cart-logic/SKILL.md
skills/payments-checkout/cart-logic/evals/cart-data-model-upsert-price-capture-ser/criteria.json
skills/payments-checkout/cart-logic/evals/cart-data-model-upsert-price-capture-ser/task.md
skills/payments-checkout/cart-logic/evals/guest-cart-persistence-and-react-cart-co/criteria.json
skills/payments-checkout/cart-logic/evals/guest-cart-persistence-and-react-cart-co/task.md
skills/payments-checkout/cart-logic/evals/guest-to-user-cart-merge-on-login/criteria.json
skills/payments-checkout/cart-logic/evals/guest-to-user-cart-merge-on-login/task.md
skills/payments-checkout/cart-logic/tile.json