Your cart is empty!
Before Redirect
public function onRedirectOrder( string &$url, int $ordId ) : void
Fires before redirecting the user to the summary landing page of a take-away order.
Description
Trigger hook to manipulate the redirect URL after completing the food ordering process (take-away order).
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 order, such as to send custom notifications.
Parameters
- &$url
-
(string) The URL to reach after completing the ordering process.
- $ordId
-
(int) The ID of the newly saved order.
Return Value
None.
Example
/**
* Trigger event to manipulate the redirect URL after completing
* the food ordering process (take-away order).
*
* @param string &$url The redirect URL (plain).
* @param int $ordId The order id.
*
* @return void
*/
public function onRedirectOrder(&$url, $ordId)
{
// access the order details, if needed
$order = VREOrderFactory::getOrder($ordId);
// it is possible to overwrite the landing page after completing the order
$url = 'index.php';
}
Changelog
Version | Description |
---|---|
1.9 | Introduced. |
Last Update: 2023-12-29 14:15
Helpful?