PluginProbe
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses / 4.1.6.9.2
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses v4.1.6.9.2
4.4.8 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 All 139 releases
learnpress / templates / order / order-details.php

order-details.php in LearnPress – WordPress LMS Plugin for Create and Sell Online Courses 4.1.6.9.2, at templates/order/order-details.php

129 lines 3.4 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 order details.
4 *
5 * This template can be overridden by copying it to yourtheme/learnpress/order/order-details.php.
6 *
7 * @author ThimPress
8 * @package Learnpress/Templates
9 * @version 4.0.1
10 */
11
12 defined( 'ABSPATH' ) || exit();
13
14 if ( ! isset( $order ) ) {
15 echo esc_html__( 'Invalid order', 'learnpress' );
16 return;
17 }
18 ?>
19
20 <h3><?php esc_html_e( 'Order Details', 'learnpress' ); ?></h3>
21
22 <table class="lp-list-table order-table-details">
23 <thead>
24 <tr>
25 <th class="course-name"><?php esc_html_e( 'Course', 'learnpress' ); ?></th>
26 <th class="course-total"><?php esc_html_e( 'Total', 'learnpress' ); ?></th>
27 </tr>
28 </thead>
29
30 <tbody>
31 <?php
32 $items = $order->get_items();
33 if ( $items ) {
34 $currency_symbol = learn_press_get_currency_symbol( $order->get_currency() );
35
36 foreach ( $items as $item_id => $item ) {
37 if ( ! isset( $item['course_id'] ) ) {
38 continue;
39 }
40
41 $price = (float) $item['subtotal'];
42 if ( $price <= 0 ) {
43 $price = __( 'Free', 'learnpress' );
44 } else {
45 $price = learn_press_format_price( $price, $currency_symbol );
46 }
47
48 if ( apply_filters( 'learn-press/order/item-visible', true, $item ) ) {
49 $course = learn_press_get_course( $item['course_id'] );
50
51 if ( ! $course || ! $course->exists() ) {
52 ?>
53 <tr class="<?php echo esc_attr( apply_filters( 'learn-press/order/item-class', 'order-item', $item, $order ) ); ?>">
54 <td class="course-name">
55 <?php echo apply_filters( 'learn-press/order/item-name', sprintf( '%s', $item['name'] ), $item ); ?>
56 </td>
57 <td class="course-total">
58 <?php
59 echo '<span class="course-price">' . esc_html( $price ) . '</span>';
60 ?>
61 </td>
62 </tr>
63 <?php
64 continue;
65 }
66 ?>
67
68 <tr class="<?php echo esc_attr( apply_filters( 'learn-press/order/item-class', 'order-item', $item, $order ) ); ?>">
69 <td class="course-name">
70 <?php
71 echo apply_filters(
72 'learn-press/order/item-name',
73 sprintf(
74 '<a href="%s">%s</a>',
75 esc_url_raw( get_permalink( $item['course_id'] ) ),
76 esc_html( $item['name'] )
77 ),
78 $item
79 );
80 ?>
81 </td>
82
83 <td class="course-total">
84 <?php
85 $origin_price = $course->get_regular_price_html();
86
87 if ( $course->has_sale_price() ) {
88 echo '<span class="course-origin-price">' . wp_kses_post( $origin_price ) . '</span>';
89 }
90 echo '<span class="course-price">' . wp_kses_post( $price ) . '</span>';
91 ?>
92 </td>
93 </tr>
94
95 <?php
96 }
97 }
98 }
99 ?>
100
101 <?php do_action( 'learn-press/order/items-table', $order ); ?>
102 </tbody>
103
104 <tfoot>
105 <tr>
106 <th scope="row"><?php esc_html_e( 'Subtotal', 'learnpress' ); ?></th>
107 <td><?php echo esc_html( $order->get_formatted_order_subtotal() ); ?></td>
108 </tr>
109 <tr>
110 <th scope="row"><?php esc_html_e( 'Total', 'learnpress' ); ?></th>
111 <td><?php echo esc_html( $order->get_formatted_order_total() ); ?></td>
112 </tr>
113 </tfoot>
114 </table>
115
116 <p>
117 <strong><?php echo esc_html__( 'Order key:', 'learnpress' ); ?></strong>
118 <?php echo esc_html( $order->get_order_key() ); ?>
119 </p>
120
121 <p>
122 <strong><?php esc_html_e( 'Order status:', 'learnpress' ); ?></strong>
123 <span class="lp-label label-<?php echo esc_attr( $order->get_status() ); ?>">
124 <?php echo wp_kses_post( $order->get_order_status_html() ); ?>
125 </span>
126 </p>
127
128 <?php do_action( 'learn-press/order/after-table-details', $order ); ?>
129