English (United Kingdom)

apply_filters( 'vikappointments_empty_cart', bool $status, VAPCart $cart )

Fires before the cart gets emptied.


Description

Trigger hook before flushing the cart.

It is still possible to see what kind of items $cart holds, since the cart is emptied after firing this hook.


Parameters

$status

(bool)  True on success, false otherwise.

$cart

(VAPCart)  The cart instance.


Example

/**
 * Trigger hook before flushing the cart.
 *
 * @param  boolean  $status  True on success, false otherwise.
 * @param  mixed    $cart    The cart instance.
 */
add_filter('vikappointments_empty_cart', function($status, $cart)
{
    /**
     * @todo do stuff here
     */

    return $status;
}, 10, 2);

Changelog

Version Description
1.0 Introduced.
Last Update: 2021-08-04
Helpful?