public function onRedirectOrder(string &$url, int $order) : void

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

&$url

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

$order

(int)  The ID of the newly saved order.

Return Value

None.


Example

/**
 * Trigger event to manipulate the redirect URL after completing
 * the appointment booking process.
 *
 * @param   string   &$url   The redirect URL (plain).
 * @param   integer  $order  The order id.
 *
 * @return  void
 */
public function onRedirectOrder(&$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';
}

Changelog

VersionDescription
1.7.0 The $order argument doesn't contain anymore the details of the order. Only the ID of the order is reported.
1.6.4 Introduced.
Last Update: 2021-10-08 14:59
Helpful?
See Also: