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