English (United Kingdom)

apply_filters_ref_array( 'vikappointments_redirect_subscription_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 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

$status

(bool)  True on success, false otherwise.

&$url

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

$order

(int)  The ID of the newly saved order.


Example

/**
 * Trigger hook to manipulate the redirect URL after completing
 * the subscription purchase 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_subscription_order', function($status, &$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';

    return $status;
}, 10, 3);

Changelog

Version Description
1.2 Introduced.
Last Update: 2021-08-05
Helpful?
See Also: