public function onRedirectSubscriptionOrder(string &$url, int $order) : bool

Fires before redirecting the user to the summary landing page.


Description

Trigger hook to manipulate the redirect URL after completing the ordering process of a subscription.

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


Parameters

&$url

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

$order

(int)  The ID of the newly saved order.

Return Value

None.


Example

/**
 * Trigger hook to manipulate the redirect URL after completing
 * the subscription purchase process.
 *
 * @param   string   &$url   The redirect URL (plain).
 * @param   integer  $order  The order id.
 *
 * @return  void
 */
public function onRedirectSubscriptionOrder(&$url, $order)
{
    // access the order details, if needed
    $order = VAPOrderFactory::getCustomerSubscription($order);

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

Changelog

VersionDescription
1.7 Introduced.
Last Update: 2021-10-08 15:20
Helpful?
See Also: