Cart & Checkout
The cart persists items from product browsing through to order placement. Checkout collects billing, shipping, payment, and submits the order.
Cart
- UUID-based; can be anonymous or tied to a logged-in customer
- Persists for 14 days by default
- Reserves inventory — adding to cart allocates a unit to that cart, preventing overselling
- Automatically recalculates subtotal when items or addons change
Cart item addons
A cart item can have service addons (e.g. warranty, protection plan) attached:
- Selected at the product detail page
- Each addon has its own price
- Variation selection (1-year, 2-year, 3-year) is saved per cart item
Cart addon products
Standalone addon products (cases, chargers) are added as their own line items. They aren't attached to a specific product.
Checkout flow
- Contact info — email
- Shipping address — name, address, city, state, ZIP
- Shipping rates — fetched from FedEx + UPS in real time; customer picks one
- Tax — calculated server-side from shipping state + tenant tax config
- Payment — Stripe / PayPal / Klarna / Afterpay (whichever are enabled for the tenant)
- Promo code / gift card — optional
- Submit — creates an order, captures payment, sends confirmation email
Free shipping threshold
If the tenant has a free_shipping_threshold, carts above that amount see a "Free shipping applied" message and shipping cost is zeroed.
Guest checkout
If enable_guest_checkout is true for the tenant, customers can check out without creating an account. They still receive an order confirmation and can look up their order by number + email.
Promo codes
Promo codes are validated server-side at checkout:
- Percentage, fixed, or free shipping discounts
- Min order amount, max discount, usage limits
- Per-customer limits tracked via
commerce__promotion_usage
See Promotions for admin config.
Gift cards
Gift cards are applied as a balance against the order total. If the balance exceeds the order, the remainder stays on the card. If the order exceeds the balance, the customer pays the difference via their selected payment method.
Abandoned cart recovery
A cron job (commerce-cart-abandonment.php) emails customers whose carts sat inactive >24 hours with items still in them. Configurable per tenant.