English (United Kingdom)
Knowledge Base  >  Vik Appointments  >  Hooks  >  Purchase  >  Packages  >  Initialization

apply_filters( 'vikappointments_init_save_packages_order', bool $status, VAPCartPackages $cart )

Fires at the beginning of the saving process.


Description

Trigger hook to manipulate the cart instance while saving a package order. Here's possible to manipulate the cart instance.

This is the first hook that triggers after clicking the "Confirm Order" button.


Parameters

$status

(bool)  True on success, false otherwise.

$cart

(VAPCartPackages)  The cart instance.


Example

/**
 * Trigger hook to manipulate the cart instance.
 *
 * @param  boolean          $status  True on success, false otherwise.
 * @param  VAPCartPackages  $cart    The cart instance.
 */
add_filter('vikappointments_init_save_packages_order', function($status, $cart)
{
    /**
     * @todo do stuff here
     */

    return $status;
}, 10, 2);

Changelog

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