spree-checkout
Installation
SKILL.md
Spree Checkout
Checkout in Spree 6 is data-driven, not a state machine. A Spree::Cart collects items, addresses, delivery and payment in any order; the cart reports what it still needs (requirements); and exactly one hard gate — the Spree::Carts::Complete workflow — turns it into an immutable Spree::Order.
Coming from 5.x (
order.next!,checkout_flow,state)? Those APIs are gone — seespree-upgrade-5-to-6.
Cart vs Order
Spree::Cart (cart_…) |
Spree::Order (or_…) |
|
|---|---|---|
| Phase | Shopping + checkout | Placed purchase (financial record) |
| Lifecycle marker | completed_at only — no status column |
status (draft/placed/canceled) + payment_status / fulfillment_status |
| Mutable? | Yes, until completed; then read-only (readonly? blocks every write) |
Items/prices frozen; admin edits go through explicit services |
| Checkout introspection | requirements, checkout_steps, current_checkout_step, completed_checkout_steps |
None — it's already placed |
| Money | Rows regenerated on every recalculation | Rows frozen; totals only re-summed |
Records that live through both phases — LineItem, Fulfillment, Payment, PaymentSession, StockReservation, TaxLine, Discount, Fee — carry two nullable FKs (cart_id + order_id, exactly one set). Always read the parent through #owner: