Models
Shopper uses seven models to manage orders:
The Order model implements
Shopper\Core\Models\Contracts\Order and uses SoftDeletes. It is configurable via config/shopper/models.php.
Extending the Model
To add custom behavior, extend the model and update your configuration:config/shopper/models.php:
Database Schema
Order Table
OrderItem Table
OrderAddress Table
OrderShipping Table
OrderRefund Table
Order Status
Every order tracks three independent statuses: order status, payment status, and shipping status. This separation allows each aspect of the order to progress independently. For example, an order can be paid before it’s shipped, or partially shipped while still processing.Order Status
TheOrderStatus enum tracks the overall lifecycle of the order:
Payment Status
ThePaymentStatus enum tracks whether payment has been collected. It is updated automatically by the PaymentProcessingService as transactions succeed.
For the full payment lifecycle, capture strategies, and transaction recording, see the Payments page.
Shipping Status
TheShippingStatus enum tracks the overall shipping state at the order level. It reflects the combined state of all shipments on the order.
For shipment-level tracking (individual packages with carriers and tracking numbers), see the Fulfillment page.
Status Check Methods
Fulfillment Status
TheFulfillmentStatus enum tracks individual item fulfillment, enabling partial shipments and multi-carrier delivery:
FulfillmentStatus is applied per item, not per order. This allows partial fulfillment when items ship at different times or from different carriers. See the Fulfillment page for complete workflows.Refund Status
TheOrderRefundStatus enum defines refund states:
Relationships
Customer
Items
Addresses
Shipping
Item Shipment
For complete multi-shipment and dropshipping workflows, see the Fulfillment page.
Refund
Channel and Zone
Discount
Orders snapshot the discount that was redeemed at placement time. Thediscount_id foreign key still resolves the original Discount model while it exists, but the four snapshot columns (discount_code, discount_type, discount_value_at_apply, discount_currency_code) preserve the data even after the originating discount is edited or deleted. This follows the Shopify pattern of immutable order records.
For the full validation and atomic reservation rules, see Usage Limit Enforcement on the Discounts page.
Parent/Child Orders
For split orders, an order can have a parent and children:Computed Values
Order Total
Thetotal() method returns the sum of all item totals in cents:
Events
Order lifecycle events are dispatched automatically throughout the order lifecycle:Creating Orders
Basic Order
Complete Order with Items and Addresses
Create the shipping and billing addresses:Query Scopes
The Order model provides two scopes for filtering by archive status:Retrieving Orders
To get all non-archived orders with their relationships:Order Number Generation
Use thegenerate_number() helper to create unique order numbers:
ORD-20260327-001234. The format is configurable in config/shopper/orders.php.
Permissions
The admin panel generates five permissions for order management:Components
To customize the admin UI for order management:config/shopper/components/order.php:
Storefront Example
In most cases, orders are created automatically when a cart is converted viaCreateOrderFromCartAction. You rarely need to create orders manually. Here is how the checkout flow and order display work:
The
CreateOrderFromCartAction handles everything in a single transaction: calculating totals, creating addresses, creating order items, applying discounts, computing taxes, and marking the cart as completed. See the Cart page for details.