English (United Kingdom)

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 doesn't fire whenever you create a new order, as the status change is observed only in case the previously configured status is not empty.

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. Always includes the id of the order and the new status.


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.
Last Update: 2023-12-28
Helpful?
This site uses cookies. By continuing to browse you accept their use. Further information