PluginProbe
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses / 4.1.7
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses v4.1.7
4.4.7 4.4.6 4.4.5 4.4.4 4.4.3 4.4.2 4.4.1 4.4.0 4.3.9.1 4.3.9 4.3.8 4.3.7 4.1.6.9 4.1.6.9.1 4.1.6.9.2 4.1.6.9.3 4.1.6.9.4 4.1.7 4.1.7.1 4.1.7.2 4.1.7.3 4.1.7.3.1 4.1.7.3.2 4.2.0 4.2.1 All 138 releases
learnpress / templates / emails / plain / order-items-table.php

order-items-table.php in LearnPress – WordPress LMS Plugin for Create and Sell Online Courses 4.1.7, at templates/emails/plain/order-items-table.php

89 lines 2.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Template for displaying the order information and items details.
4 *
5 * @author ThimPress
6 * @package LearnPress/Templates
7 * @version 3.0.0
8 * @editor tungnx
9 * @modify 4.1.3
10 */
11
12 if ( ! defined( 'ABSPATH' ) ) {
13 exit; // Exit if accessed directly
14 }
15 /**
16 * @var LP_Order $order
17 */
18 if ( ! isset( $order ) ) {
19 error_log( 'Invalid params on ' . __FILE__ );
20 return;
21 }
22
23 $items = $order->get_items();
24
25 if ( ! $items ) {
26 return;
27 }
28
29 $email_content = '';
30
31 if ( $order->is_manual() ) {
32 $user_ids = $order->get_user_id();
33 if ( is_array( $user_ids ) ) {
34 $email_arr = [];
35 foreach ( $user_ids as $user_id ) {
36 $user = get_user_by( 'ID', $user_id );
37 if ( $user ) {
38 $email_arr[] = $user->user_email;
39 }
40 }
41
42 $email_content = implode( ',', $email_arr );
43 } else {
44 $email_content = $order->get_user_email( $user_ids );
45 }
46 } else {
47 $email_content = $order->get_user_email( $order->get_user_id() );
48 }
49
50 echo '** ' . __( 'Order summary', 'learnpress' ) . " **\n";
51
52 echo '** ' . __( 'Order Number', 'learnpress' ) . ': ' . $order->get_order_number() . " **\n";
53
54 echo '** ' . __( 'Purchase Date', 'learnpress' ) . ': ' . $order->get_order_date() . " **\n";
55
56 echo '** ' . __( 'Payment Method', 'learnpress' ) . ': ' . $order->get_payment_method_title() . " **\n";
57
58 echo '** ' . __( 'Status', 'learnpress' ) . ': ' . strip_tags( $order->get_order_status_html() ) . " **\n";
59
60 echo '** ' . __( 'User Email', 'learnpress' ) . ': ' . $email_content . " **\n\n";
61
62
63 $count = 0;
64 foreach ( $items as $item_id => $item ) :
65
66 $course = apply_filters( 'learn-press/order/item-course', learn_press_get_course( $item['course_id'] ), $item );
67
68 if ( $count ) {
69 echo "\n*****************\n";
70 }
71
72 do_action( 'learn-press/before-email-order-item', $item_id, $item, $order );
73
74 echo apply_filters( 'learn-press/email-order-item-name', $item['name'], $item );
75
76 echo "\n" . sprintf( __( 'Quantity: %s', 'learnpress' ), apply_filters( 'learn-press/email-order-item-quantity', $item['quantity'], $item ) );
77
78 echo "\n" . sprintf( __( 'Cost: %s', 'learnpress' ), apply_filters( 'learn-press/email-order-item-cost', $item['total'] . ' ' . $order->get_currency(), $item ) );
79
80 do_action( 'learn-press/after-email-order-item', $item_id, $item, $order );
81
82 $count ++;
83
84 endforeach;
85
86 echo "\n\n+++++++++++++++++++++++++\n\n";
87
88 echo __( 'Total', 'learnpress' ) . ': ' . $order->get_formatted_order_total();
89