English (United Kingdom)

apply_filters( 'vikappointments_before_validate_customer_subscription', bool $subscribed, mixed $customer, array $services, mixed $checkin )

Fires before checking whether a customer owns an active subscription.


Description

This hook can be used to apply additional conditions to the subscription validation.

It can be used to skip the default system validations.

NOTE: calling $customer->isSubscribed() would result in recursion.


Parameters

$subscribed

(bool|null)  True to flag the customer as subscribed, false to flag it as expired or not yet subscribed, null to rely on the default system.

$customer

(VAPCustomer)  The object holding the customer details.

$id

(array)  A list of services to check.

$checkin

(string)  An optional check-in date (UTC).


Example

/**
 * This hook can be used to apply additional conditions to the subscription validation.
 * It can be used to skip the default system validations.
 *
 * @param  mixed        $subscribed  True to flag the customer as subscribed, false to flag it as
 *                                   expired or not yet subscribed, null to rely on the default system.
 * @param  VAPCustomer  $customer    The customer details.
 * @param  array        $services    A list of services to check.
 * @param  mixed        $checkin     An optional check-in date (UTC). 
 */
add_filter('vikappointments_before_validate_customer_subscription', function($subscribed, $customer, $id, $checkin)
{
    /**
     * @todo here it is possible to intercept the default validation method
     */

    return $subscribed;
}, 10, 4);

Changelog

Version Description
1.2 Introduced.
Last Update: 2021-08-23
Helpful?

This website uses cookies

This website uses cookies and similar technologies. Some of these technologies are necessary for the proper functioning of the website (Essential). Other technologies are used to evaluate user behavior (Analysis), to integrate external media or for advertising purposes. If you agree, these technologies are activated. For details, please refer to the privacy policy. From this same page you can also update/revoke your consent. If you do not give your consent, only cookies with essential functions will be activated.

We use technologies from the USA on our website. If you give your consent, you therefore consent at the same time to your data being transferred to the USA. We would like to point out that the USA does not have a level of data protection comparable to that of the EU and that any US company can be obliged by state authorities to hand over your data without you having any effective legal protection against this.