Digital delivery, customer access, admin orders, and refunds.
Digital product fields
| Field key | Type | Purpose |
|---|---|---|
digital_file | number (media ID) | Secure file download after purchase |
digital_url | url | External URL redirect after purchase |
digital_entry_slug | text | Published entry slug unlocked after purchase |
digital_label | text | Link label (default Download) |
Priority when multiple are set: file → url → entry slug.
Grants and access
When an order is marked paid, DigitalFulfillmentService creates grants. Customers access downloads via:
- Email — Links in order confirmation (when emails enabled)
- Account —
/commerce/orders/{order_number}(requires sign-in) - Token URL —
/commerce/access/{64-char-token}works from email without sign-in
Delivery types
| Type | Behaviour |
|---|---|
| File | Streams media file from disk |
| URL | Redirects to configured URL |
| Entry | Redirects to /{product-type}/{slug} |
Requires migration 054 (cms_commerce_digital_grants).
Order history
- Logged-in customers —
/commerce/orderslists orders by account and email - Guests —
/commerce/orders/lookupwith order number + email
Orders link to PHPAuth accounts via customer_user_id when buyer logged in at checkout, or automatically when Stripe email matches existing account.
Fulfillment on payment
- Inventory — Decrement
stock_qtywhen tracking enabled - Digital grants — Issue download tokens
- Emails — Customer confirmation with totals and ship-to; optional admin notification
- Coupons — Increment use count once per order
Admin order management
- Orders list — Filters by status, email, order #, date range
- Order detail — Line items, payment status, shipping address
- Refund order — Stripe Refund API; marks order refunded; restores inventory; revokes digital grants
- Digital grant actions — Resend delivery email, Revoke, Regenerate token
- Export CSV — Respects list filters for accounting
Troubleshooting
- No download email — Emails disabled in settings or mail() misconfigured on server.
- Token expired or revoked — Regenerate from admin order detail after refund check.
- File download 404 — Media file missing from
public/uploads/; restore from backup.