Skip to the content
Documentation
Help Start
Reading in:
  • German: 9,110 of 9,110 pages
About the help in other languages
All help pages

Status transitions and permissions

How Exponential decides who may change an order's status - the shop/setstatus policy with its FromStatus and ToStatus limitations, how several policies combine, role designs for packing staff, customer service and…

Download as PDF

Address: https://doc.exponential.earth/exphelp/viewer/help/e-commerce/orders/status-transitions-and-permissions.md

On this page

Status transitions and permissions

This page is for merchants and administrators who decide who may move orders from one status to another. The shop has a policy function for exactly this, shop/setstatus, with two limitations. Used well, it turns your status process into enforced steps.

Contents

  1. The policy and its limitations
  2. How the check works
  3. Role designs
  4. Editing the status list itself
  5. Testing the roles

The policy and its limitations

kernel/shop/module.php defines setstatus with two limitations, both lists of order statuses:

LimitationMeaning
FromStatusThe order's current status must be in this list
ToStatusThe new status must be in this list

Without limitations, shop/setstatus allows any change. The status choices offered on the order view are the statuses the current user may set for that order (eZOrder::statusModificationList()).

How the check works

eZOrder::canModifyStatus() (kernel/classes/ezorder.php) reads the user's access to shop/setstatus:

  • Access "yes" (a policy without limitations): every change is allowed.
  • Access "limited": each policy is checked on its own. A policy allows the change when the current status is in its FromStatus (if set) and the new status is in its ToStatus (if set). If any one policy allows it, the change is allowed.

So limitations combine within one policy (both must hold) and policies combine with "or". To give someone two separate steps, give them two policies, not one policy with both lists merged: merging would also allow the cross-combinations.

Role designs

Example with a parcel process (Pending, Paid, Packed, Shipped, Completed, On hold, Cancelled, Refunded):

Roleshop/setstatus policiesEffect
Packing1: From Paid, To Packed or On hold. 2: From Packed or On hold, To Shipped or PackedCan only move paid orders through packing and shipping
Customer service1: From Pending or Awaiting payment, To Cancelled. 2: From Shipped or Delivered, To Return requestedCan cancel unpaid orders and open returns
Store managerNo limitationAny change, including refunds
OwnerNo limitation, plus shop/edit_status and shop/setupAlso edits the status list, VAT and prices

All shop staff roles also need shop/administrate to see the order list and order view in the Store tab (Paths by role). Build the roles in Setup > Roles and policies (Roles and policies).

Editing the status list itself

shop/status (policy shop/edit_status) edits the list of statuses: add custom statuses (ids from 1000), rename them, and set whether they are active. Keep this with the owner: a renamed status changes what every role's limitations mean.

Testing the roles

  • To do: Sign in as a test user of each role, not as an administrator.
  • To do: Open an order in each status and check the offered choices against the table you designed.
  • To do: Try a change that should be refused; it must not be offered.
  • To do: Check the order's status history shows the test user and time.
  • To do: With the audit trail on, check commerce.order.status records the changes (Commerce audit trail).

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.

Something wrong on this page? Report an error

Documentation license

This documentation is free documentation, licensed under the GNU Free Documentation License 1.3 or later.

Exponential Copyright © 1998-2026 Exponential Foundation and 7x