Cart
First-Pass Node Dossier
This page is an evidence-backed node dossier generated from the domain hierarchy and node questionnaire.
What It Is
Cart is not a separate model in this repo. It is an Order record in cart state, identified by cart = true and a cart_token, and used for storefront item selection, address capture, shipment selection, and checkout readiness.
Parent hierarchy:
Order LifecycleCart State And Checkout ReadinessCart
Primary implementation paths:
packages/framework/src/Models/Order.phppackages/framework/src/Http/Controllers/Api/Storefront/CartsController.phppackages/framework/src/Http/Controllers/Api/Storefront/CartItemsController.phppackages/framework/src/Actions/Cartpackages/storefront/src/Livewire/Storefront/Cart
What Users Can Do With It
Direct capabilities
Users can:
- create, show, update, and delete carts through the storefront API
- add, update, and remove cart items
- set customer, shipping address, and billing address
- choose shipment-level delivery methods and dates through the shipment flows
- confirm purchase when checkout requirements are satisfied
Indirect capabilities
Other workflows also use Cart:
- cart validation and notifications
- default shipping-service selection after address updates
- abandoned-cart detection and follow-up
- redirect to payment gateway checkout
Things users cannot do directly
This pass did not find a separate packaged admin cart page. Carts surface in the shared package mainly through storefront cart pages and admin order filters, not through a separate admin workspace.
Where It Is Managed
| Channel | Role | Notes |
|---|---|---|
| Storefront cart pages | Direct | Main packaged UI for cart review and checkout readiness |
Storefront API (carts, carts.items, carts.shipments) | Direct | Underlying create, update, item, and shipment operations |
| Admin orders list | Indirect | Staff can filter or inspect orders that are still carts |
| Payment gateway redirect | Indirect | Checkout transition happens after cart validation passes |
Sources:
packages/storefront/routes/web.phppackages/framework/routes/storefront.phppackages/framework/src/Http/Controllers/Api/Storefront/CartsController.phppackages/framework/src/Http/Controllers/Api/Storefront/CartItemsController.phppackages/storefront/src/Livewire/Storefront/Cart/PageContent.php
Channel-Level Field Coverage
Cart creation
Creating a cart sets:
user_idcustomer_id- optional
product_inventory_location_id currency- optional
project_number - optional
reference_number cart = true
Source:
packages/framework/src/Http/Controllers/Api/Storefront/CartsController.php
Cart update
The cart update flow supports:
noteemailcurrencygift_messagegiftshipping_address_idbilling_address_idcustomer_reference_numberreference_numberproject_number
Source:
packages/framework/src/Http/Controllers/Api/Storefront/CartsController.php
Checkout-readiness rules
The packaged storefront checkout gate requires:
- a reference number
- at least one item
- a shipping address
- a billing address
- shipping service selection for required items
- a shipment pickup or delivery date
- no critical cart notifications
Source:
packages/storefront/src/Livewire/Storefront/Cart/SummarySection.php
Configuration And Data Model
Key model characteristics:
- implemented on
Order - identified by
cart = true - keyed for shopper access by
cart_token - can later become a non-cart order when confirmed or reassigned
Important related records:
items()shipments()shippingLines()criticalNotifications()nonCriticalNotifications()
Source:
packages/framework/src/Models/Order.php
Relationships
Cart directly depends on:
OrderItemOrderShipmentOrderShippingLine- customer and address relations on
Order
Practical dependents:
- shipment selection
- cart notifications
- payment redirect
- abandoned-cart follow-up
Rules And Downstream Effects
Address and offer side effects
Setting the shipping address can:
- assign the shipping address to the cart
- optionally copy it to billing
- recalculate product offers in cart when configured
- remove invalid items
- select default shipping services
Sources:
packages/framework/src/Http/Controllers/Api/Storefront/CartsController.phppackages/framework/src/Actions/Cart/RecalculateProductOffers.phppackages/framework/src/Actions/Cart/SelectDefaultShippingService.php
Cart-to-order transition
When a cart is confirmed:
AddToCreditLineruns- the order can move toward payment/confirmation behavior
- the record stays on the same
Orderaggregate rather than moving into a separate order table
Sources:
packages/storefront/src/Livewire/Storefront/Cart/SummarySection.phppackages/framework/src/Actions/Cart/AddToCreditLine.php
State conversion caveat
If a draft cart is reassigned to an owner through Order/UpdateOrder, the action can flip cart to false and clear existing notifications.
Source:
packages/framework/src/Actions/Order/UpdateOrder.php
Integrations And Automation
Cart validation
ValidateCart runs pipeline-driven checks and manages notification cleanup when validation should be skipped.
Source:
packages/framework/src/Actions/Cart/ValidateCart.php
Abandoned-cart workflow
The shared package includes eligibility checks and notification sending for abandoned carts.
Sources:
packages/framework/src/Models/Order.phppackages/framework/src/Actions/Order/CheckForAbandonedCarts.phppackages/framework/src/Actions/Order/SendAbandonedCartNotification.php
Payment gateway redirect
The cart can redirect to Stripe checkout through the storefront API and order checkout-url generation.
Sources:
packages/framework/src/Http/Controllers/Api/Storefront/CartsController.phppackages/framework/src/Actions/Stripe/CreateStripeCheckout.php
Where It Appears To End Users
Cart is one of the strongest packaged shopper-facing concepts in the repo.
Shoppers use it through:
- storefront cart pages
- shipment cards
- address blocks
- summary and checkout confirmation
Staff mainly consume it through adjacent order review surfaces and filters.
Current Documentation Takeaways
Cartis anOrderin cart state, not a separate model.- Checkout readiness is enforced by explicit cart rules and notifications, not only by UI affordances.
- Shipping selection, addresses, and references are part of the cart phase and materially change whether checkout can proceed.
Open Questions
- This first pass did not audit every cart-validation pipe configuration, only the shared validation entrypoint and the main storefront behaviors.