Your cart is empty!
Status Change
do_action( 'vikrestaurants_status_change_takeaway_order', array $data )
Fires every time the status of an order changes.
Description
Trigger event to let the plugins be notified every time the status of a take-away order changes.
This hook also fires when a new order is created, since its initial status always differs from the previously configured status, which did not exist before the order was created.
It is possible to use the following code to access all the details of the order.
$order = VREOrderFactory::getOrder($data['id']);
Parameters
- $data
-
(array) The details of the saved order.
id(int) - The ID of the created/updated order.status(string) - The new status code of the order.prev(string) - The previous status code of the order. Empty in case the order has been created.
Example
/**
* Trigger event to let the plugins be notified every time the status of the orders change.
*
* @param array $data The details of the saved order.
*/
add_action('vikrestaurants_status_change_takeaway_order', function($data) {
/**
* @todo status change observed, do something now
*/
}); Changelog
| Version | Description |
|---|---|
| 1.3 | Introduced. |
| 1.5.5 | The $data argument no longer contains extra details about the updated order. |
Last Update: 3 days ago
Helpful?