Filter
rpress_next_order_status
On this page
Filters the status an order moves to on its next fulfilment step.
Applied by rpress_get_next_order_status(), which follows the tracker steps for the service: delivery includes transit and other services use the pickup flow. It sets the target of the next-step action in the orders list and the next step on the order details screen. 'cancelled' is never offered by default, and '' means there is no next step. The filter changes only the suggestion, not the order itself.
Available since RestroPress 3.5.1.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$next | string | Next status key, or ''. |
$status | string | Current order status ('out_for_delivery' arrives as 'transit'). |
$service_type | string | Service type, such as 'delivery', 'pickup' or 'dinein'. |
Return value#
string. Next status key, or ''.
Example#
add_filter( 'rpress_next_order_status', 'my_next_order_status', 10, 3 );
function my_next_order_status( $next, $status, $service_type ) {
if ( 'dinein' === $service_type && 'accepted' === $status ) {
return 'ready';
}
return $next;
}
Notes#
Not applied for completed, cancelled, failed, refunded, empty or unknown statuses. The orders list shows its action only for statuses it has a label for.
Source#
Applied in:
includes/payments/functions.php(line 1108), inrpress_get_next_order_status()
See also#
Was this page helpful?
