Temporary orders and activation
This page is for developers and store managers who wonder why an order can exist without an order number, or why a payment provider shows a payment that the order list does not. It explains the temporary order: the record the checkout works on until payment has finished.
Contents
- What a temporary order is
- Its life
- What activation changes
- Where temporary orders show and where they do not
- Order id and order number
- What this means for you
What a temporary order is
When the customer checks out, eZBasket::createOrder() (kernel/classes/ezbasket.php) creates a row in ezorder
with is_temporary = 1, the status Pending, the current user and the basket's product collection. The basket
remembers the order (order_id) and the session remembers it as MyTemporaryOrderID. Basket and temporary order
share one product collection, so items are not copied.
Its life
| Moment | State |
|---|---|
| Checkout button, customer data given | Temporary order created, order_nr = 0 |
| Confirmation page | Shipping lines added as order items; still temporary |
| Cancel on the confirmation page | The basket comes back with its items |
| Payment started (redirect gateway) | A payment object is stored for the workflow process; still temporary |
| Payment confirmed, workflow continues | activate-order runs: the order is placed |
| Payment never confirmed | Remains temporary; never shown as an order |
What activation changes
eZOrder::activate() (kernel/classes/ezorder.php), run by the activate-order method of the checkout operation:
is_temporarybecomes0.- The order gets its order number from the separate counter table
ezorder_nr_incr. - A first entry in the status history is created for the current status.
- When the audit trail is active, the event
commerce.order.createis recorded with the order number, total and currency, never the customer's address (Commerce audit trail).
Right after activation the checkout operation sends the order mail (send-order-email) and runs the after trigger of
shop_checkout. The basket is emptied when checkout finishes, unless ClearBasketOnCheckout=enabled emptied it
earlier (site.ini shop settings walkthrough).
Where temporary orders show and where they do not
Order list, archive, customer list, order statistics and counts all filter on is_temporary = 0
(kernel/classes/ezorder.php). Temporary orders therefore do not count as orders or revenue. The Store dashboard lists
"unconfirmed checkouts" under Work to do, which is where to look for checkouts that stopped half way
(Store dashboard and order statuses).
Basket cleanup removes expired baskets and their product collections (eZBasket::cleanupExpired()); in the code
we checked it does not delete rows from ezorder.
Order id and order number
Order id (id) | Order number (order_nr) | |
|---|---|---|
| Given | When the temporary order is created | When the order is activated |
| Gaps | Yes: every abandoned checkout uses an id | Only placed orders get one |
| Shown to | Internal addresses such as shop/orderview/<id> | Customers, in the order view, mail and receipt |
Tell customers and staff to quote the order number. Remote services can look up an order by number
(exporder::byNumber, Headless commerce with expservices).
What this means for you
- A provider's payment without an order in the list means activation never ran: the callback did not arrive or the workflow did not continue (Troubleshooting checkout).
- Events that need the order number or must run once per placed order belong on the after trigger of
shop_checkout, not on the before trigger (Workflows on shop triggers). - Reports built on the
ezordertable must filteris_temporary = 0, like the kernel does.
Related pages
- Checkout operations step by step
- Order lifecycle operations
- Orders and order statuses
- Free documentation: this page is free to copy, translate and improve under the GNU FDL 1.3.
Become an Exponential Partner
Partners share their information, provide funding, contribute back and develop the products with us, and that is how Exponential grows. A partner website and dashboard are planned for mid-2027: please become a partner today to speed up our growth rate and land new features faster.