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.1 3.6.2 3.6.3 3.6.4 3.7.0 3.7.1 3.7.2 3.7.3 3.7.4 3.8.0 3.8.1 3.8.2 3.8.3 3.9.0 3.9.1 3.9.10 3.9.2 3.9.3 3.9.4 3.9.5 3.9.6 3.9.7 3.9.8 3.9.9
tutor / ecommerce / AdminMenu.php
tutor / ecommerce Last commit date
Cart 10 months ago PaymentGateways 3 months ago AdminMenu.php 9 months ago BillingController.php 1 year ago CartController.php 1 year ago CheckoutController.php 3 months ago CouponController.php 5 months ago Ecommerce.php 1 year ago EmailController.php 11 months ago HooksHandler.php 4 months ago OptionKeys.php 1 year ago OrderActivitiesController.php 1 year ago OrderController.php 6 months ago PaymentHandler.php 9 months ago Settings.php 9 months ago Tax.php 9 months ago currency.php 5 months ago
AdminMenu.php
121 lines
1 <?php
2 /**
3 * AdminMenu class for registering menu
4 *
5 * @package Tutor\Ecommerce
6 * @author Themeum
7 * @link https://themeum.com
8 * @since 3.0.0
9 */
10
11 namespace Tutor\Ecommerce;
12
13 use TUTOR\Input;
14 use Tutor\Models\OrderModel;
15
16 /**
17 * Register ecommerce menu
18 */
19 class AdminMenu {
20 /**
21 * Constructor
22 */
23 public function __construct() {
24 add_filter( 'tutor_admin_menu', array( $this, 'register_menu' ) );
25 }
26
27 /**
28 * Register menu
29 *
30 * @since 3.0.0
31 * @since 3.8.0 param menu added.
32 *
33 * @param array $menu menu.
34 *
35 * @return array
36 */
37 public function register_menu( $menu ) {
38 $order_menu_title = __( 'Orders', 'tutor' );
39 $order_badge_count = get_transient( OrderModel::TRANSIENT_ORDER_BADGE_COUNT );
40
41 if ( false === $order_badge_count ) {
42 $order_badge_count = ( new OrderModel() )->get_order_count(
43 array(
44 'payment_status' => OrderModel::PAYMENT_UNPAID,
45 'order_type' => OrderModel::TYPE_SINGLE_ORDER,
46 )
47 );
48 set_transient( OrderModel::TRANSIENT_ORDER_BADGE_COUNT, $order_badge_count, HOUR_IN_SECONDS );
49 }
50
51 if ( $order_badge_count ) {
52 $order_menu_title .= ' <span class="update-plugins"><span class="plugin-count">' . $order_badge_count . '</span></span>';
53 }
54
55 $menu['group_two']['orders'] = array(
56 'parent_slug' => 'tutor',
57 'page_title' => __( 'Orders', 'tutor' ),
58 'menu_title' => $order_menu_title,
59 'capability' => 'manage_options',
60 'menu_slug' => OrderController::PAGE_SLUG,
61 'callback' => array( $this, 'orders_view' ),
62 );
63
64 $menu['group_two']['coupons'] = array(
65 'parent_slug' => 'tutor',
66 'page_title' => __( 'Coupons', 'tutor' ),
67 'menu_title' => __( 'Coupons', 'tutor' ),
68 'capability' => 'manage_options',
69 'menu_slug' => CouponController::PAGE_SLUG,
70 'callback' => array( $this, 'coupons_view' ),
71 );
72
73 return $menu;
74 }
75
76 /**
77 * Orders view page
78 *
79 * @since 3.0.0
80 *
81 * @return void
82 */
83 public function orders_view() {
84 $current_page = Input::get( 'page' );
85 $action = Input::get( 'action' );
86
87 if ( OrderController::PAGE_SLUG === $current_page && 'edit' === $action ) {
88 ?>
89 <div class="tutor-admin-wrap tutor-order-details-wrapper">
90 <div id="tutor-order-details-root">
91 </div>
92 </div>
93 <?php
94 return;
95 }
96
97 include apply_filters( 'tutor_order_list_page_template', tutor()->path . 'views/pages/ecommerce/order-list.php' );
98 }
99
100 /**
101 * Coupons view page
102 *
103 * @since 3.0.0
104 *
105 * @return void
106 */
107 public function coupons_view() {
108 $action = Input::get( 'action' );
109 if ( in_array( $action, array( 'add_new', 'edit' ) ) ) {
110 ?>
111 <div class="tutor-admin-wrap">
112 <div id="tutor-coupon-root">
113 </div>
114 </div>
115 <?php
116 return;
117 }
118 include tutor()->path . 'views/pages/ecommerce/coupon-list.php';
119 }
120 }
121