English (United Kingdom)

apply_filters_ref_array( 'vikappointments_redirect_order', bool $status, string &$url, int $order )

Fires before redirecting the user to the summary landing page.


Description

Trigger hook to manipulate the redirect URL after completing the appointment booking process.

This is the last triggered hook during the booking process. It is possible to use it for any kind of procedures to be applied after registering the appointments, such as to send custom notifications.


Parameters

$status

(bool)  True on success, false otherwise.

&$url

(string)  The URL to reach after completing the booking process.

$order

(int)  The ID of the newly saved order.


Example

/**
 * Trigger event to manipulate the redirect URL after completing
 * the appointment booking process.
 *
 * @param  boolean  $status  True on success, false otherwise.
 * @param  string   &$url    The redirect URL (plain).
 * @param  integer  $order   The order id.
 */
add_filter('vikappointments_redirect_order', function($status, &$url, $order)
{
    // access the order details, if needed
    $order = VAPOrderFactory::getAppointments($order);

    // it is possible to overwrite the landing page after booking an appointment
    $url = 'index.php';

    return $status;
}, 10, 3);

Changelog

Version Description
1.2 The $order argument doesn't contain anymore the details of the order. Only the ID of the order is reported.
1.0 Introduced.
Last Update: 2021-08-05
Helpful?
See Also:
This site uses cookies. By continuing to browse you accept their use. Further information