PluginProbe
Booktics – Appointment Booking Calendar for Service Businesses / 1.0.22
Booktics – Appointment Booking Calendar for Service Businesses v1.0.22
1.0.29 1.0.28 1.0.27 1.0.26 1.0.25 1.0.24 1.0.23 1.0.22 1.0.21 1.0.20 1.0.19 trunk 1.0.0 1.0.1 1.0.10 1.0.11 1.0.12 1.0.13 1.0.14 1.0.15 1.0.16 1.0.17 1.0.18 1.0.2 1.0.3 All 31 releases
booktics / core / cart / cart-service-provider.php

cart-service-provider.php in Booktics – Appointment Booking Calendar for Service Businesses 1.0.22, at core/cart/cart-service-provider.php

45 lines 942 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Booktics\Cart;
4
5 if ( ! defined( 'ABSPATH' ) ) exit;
6
7 use Booktics\Cart\Controllers\Cart_Controller;
8 use Booktics\Providers\Base_Service_Provider;
9
10 /**
11 * Customer_Service_Provider will be responsible for all customer services
12 *
13 * @package Booktics/Customer
14 */
15 class Cart_Service_Provider extends Base_Service_Provider {
16 /**
17 * Store services
18 *
19 * @var array
20 */
21 protected $services = array(
22 Cart_Controller::class,
23 );
24
25 /**
26 * Register services
27 *
28 * @return void
29 */
30 public function get_services() {
31 add_action( 'clear_auth_cookie', array( $this, 'clear_booktics_cart_on_logout' ) );
32
33 return apply_filters( 'booktics_cart_services', $this->services );
34 }
35
36 /**
37 * Clear cart on logout
38 *
39 * @return void
40 */
41 public function clear_booktics_cart_on_logout() {
42 ( new Cart_Manager() )->remove_cart_item();
43 }
44 }
45