Filter
rpress_order_tracker_steps
On this page
Filters the customer-facing order tracker steps for a service type.
Runs at the end of rpress_order_tracker_steps(). Pickup orders get Placed, Confirmed, Preparing, Ready and Picked up; delivery orders add an Out for delivery step. Each step is an array with 'status' (an order status slug) and 'label'. The receipt template and rpress_order_status_step_index() use the list.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$steps | array | Ordered list of array( 'status' => slug, 'label' => string ). |
$service_type | string | The service type, 'delivery' or 'pickup'. |
Return value#
array. The ordered list of tracker steps.
Example#
add_filter( 'rpress_order_tracker_steps', 'my_rename_tracker_ready_step', 10, 2 );
function my_rename_tracker_ready_step( $steps, $service_type ) {
foreach ( $steps as $index => $step ) {
if ( 'ready' === $step['status'] && 'pickup' === $service_type ) {
$steps[ $index ]['label'] = __( 'Ready for pickup', 'my-plugin' );
}
}
return $steps;
}
Notes#
Each step's status should exist in the model returned by rpress_order_status_model() so its position can be resolved.
Source#
Applied in:
includes/payments/functions.php(line 979), inrpress_order_tracker_steps()
See also#
Was this page helpful?
