public function onRedirectReservation( string &$url, int $resId ) : void

Fires before redirecting the user to the summary landing page of a restaurant reservation.


Description

Trigger hook to manipulate the redirect URL after completing the table booking process (restaurant reservation).

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


Parameters

&$url

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

$resId

(int)  The ID of the newly saved reservation.

Return Value

None.


Example

/**
 * Trigger event to manipulate the redirect URL after completing
 * the table booking process (restaurant reservation).
 *
 * @param   string  &$url   The redirect URL (plain).
 * @param   int     $resId  The reservation id.
 *
 * @return  void
 */
public function onRedirectReservation(&$url, $resId)
{
    // access the reservation details, if needed
    $reservation = VREOrderFactory::getReservation($resId);

    // it is possible to overwrite the landing page after booking a table
    $url = 'index.php';
}

Changelog

Version Description
1.9 Introduced.
Last Update: 2023-12-29 14:15
Helpful?