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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 1 year ago PaymentGateways 10 months ago AdminMenu.php 1 year ago BillingController.php 1 year ago CartController.php 1 year ago CheckoutController.php 11 months ago CouponController.php 11 months ago Ecommerce.php 1 year ago EmailController.php 11 months ago HooksHandler.php 10 months ago OptionKeys.php 1 year ago OrderActivitiesController.php 1 year ago OrderController.php 11 months ago PaymentHandler.php 10 months ago Settings.php 1 year ago Tax.php 11 months ago currency.php 1 year ago
AdminMenu.php
100 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_action( 'tutor_after_courses_admin_menu', array( $this, 'register_menu' ) );
25 }
26
27 /**
28 * Register menu
29 *
30 * @return void
31 */
32 public function register_menu() {
33 $order_menu_title = __( 'Orders', 'tutor' );
34 $order_badge_count = get_transient( OrderModel::TRANSIENT_ORDER_BADGE_COUNT );
35
36 if ( false === $order_badge_count ) {
37 $order_badge_count = ( new OrderModel() )->get_order_count(
38 array(
39 'payment_status' => OrderModel::PAYMENT_UNPAID,
40 'order_type' => OrderModel::TYPE_SINGLE_ORDER,
41 )
42 );
43 set_transient( OrderModel::TRANSIENT_ORDER_BADGE_COUNT, $order_badge_count, HOUR_IN_SECONDS );
44 }
45
46 if ( $order_badge_count ) {
47 $order_menu_title .= ' <span class="update-plugins"><span class="plugin-count">' . $order_badge_count . '</span></span>';
48 }
49
50 add_submenu_page( 'tutor', __( 'Orders', 'tutor' ), $order_menu_title, 'manage_options', OrderController::PAGE_SLUG, array( $this, 'orders_view' ) );
51 do_action( 'tutor_after_orders_admin_menu' );
52 add_submenu_page( 'tutor', __( 'Coupons', 'tutor' ), __( 'Coupons', 'tutor' ), 'manage_options', CouponController::PAGE_SLUG, array( $this, 'coupons_view' ) );
53 }
54
55 /**
56 * Orders view page
57 *
58 * @since 3.0.0
59 *
60 * @return void
61 */
62 public function orders_view() {
63 $current_page = Input::get( 'page' );
64 $action = Input::get( 'action' );
65
66 if ( OrderController::PAGE_SLUG === $current_page && 'edit' === $action ) {
67 ?>
68 <div class="tutor-admin-wrap tutor-order-details-wrapper">
69 <div id="tutor-order-details-root">
70 </div>
71 </div>
72 <?php
73 return;
74 }
75
76 include apply_filters( 'tutor_order_list_page_template', tutor()->path . 'views/pages/ecommerce/order-list.php' );
77 }
78
79 /**
80 * Coupons view page
81 *
82 * @since 3.0.0
83 *
84 * @return void
85 */
86 public function coupons_view() {
87 $action = Input::get( 'action' );
88 if ( in_array( $action, array( 'add_new', 'edit' ) ) ) {
89 ?>
90 <div class="tutor-admin-wrap">
91 <div id="tutor-coupon-root">
92 </div>
93 </div>
94 <?php
95 return;
96 }
97 include tutor()->path . 'views/pages/ecommerce/coupon-list.php';
98 }
99 }
100