Your cart is empty!
Remove Item
public function onRemoveItemCart(VAPCart $cart, int $id_service, int $id_employee, string $checkin) : bool
Fires before deleting an item (service) from the cart.
Description
Trigger hook before deleting a service from the cart.
It is possible to use this hook, in example, to prevent the customers from deleting specific services.
Notice that you can access the information of the appointment by using the following code.
$index = $cart->indexOf($id_service, $id_employee, $checkin);
$item = $cart->getItemAt($index);
Parameters
- $cart
-
(VAPCart) The cart instance.
- $id_service
-
(int) The service ID.
- $id_employee
-
(int) The employee ID.
- $checkin
-
(string) The check-in date time (in UTC).
Return Value
Boolean. True to delete the service from the cart, false to keep it.
Example
/**
* Trigger event before deleting an item from the cart.
*
* @param mixed $cart The cart instance.
* @param integer $id_service The service ID.
* @param integer $id_employee The employee ID.
* @param string $checkin The check-in date time (UTC).
*
* @return boolean True to delete the item, false otherwise.
*/
public function onRemoveItemCart($cart, $id_service, $id_employee, $checkin)
{
/**
* @todo check whether the appointment should be removed or not
*/
return true;
}
Changelog
Version | Description |
---|---|
1.6 | Introduced. |
Last Update: 2021-10-06 16:28
Helpful?