PluginProbe
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses / 4.4.8
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses v4.4.8
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
← All changes | templates/order/order-details.php +91 -80 4.2.04.4.8 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,101 +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( 'Item', '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 - ?>
67 - <tr class="<?php echo esc_attr( apply_filters( 'learn-press/order/item-class', 'order-item', $item, $order ) ); ?>">
68 - <td class="course-name">
69 - <?php
70 - echo apply_filters(
71 - 'learn-press/order/item-name',
72 - sprintf(
73 - '<a href="%s">%s</a>',
74 - esc_url_raw( get_permalink( $item['course_id'] ) ),
75 - esc_html( $item['name'] )
76 - ),
77 - $item
78 - );
79 - ?>
80 - </td>
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>
81 89
82 - <td class="course-total">
83 - <?php
84 - $origin_price = $course->get_regular_price_html();
90 + <td class="course-total">
91 + <?php
92 + $origin_price = $course->get_regular_price_html();
85 93
86 - if ( $course->has_sale_price() ) {
87 - echo '<span class="course-origin-price">' . wp_kses_post( $origin_price ) . '</span>';
88 - }
89 - echo '<span class="course-price">' . wp_kses_post( $price ) . '</span>';
90 - ?>
91 - </td>
92 - </tr>
93 - <?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 + }
94 103 }
95 104 }
96 - }
97 - ?>
105 + ?>
98 106
99 - <?php do_action( 'learn-press/order/items-table', $order ); ?>
100 - </tbody>
107 + <?php do_action( 'learn-press/order/items-table', $order ); ?>
108 + </tbody>
101 109
102 - <tfoot>
103 - <tr>
104 - <th scope="row"><?php esc_html_e( 'Subtotal', 'learnpress' ); ?></th>
105 - <td><?php echo esc_html( $order->get_formatted_order_subtotal() ); ?></td>
106 - </tr>
107 - <tr>
108 - <th scope="row"><?php esc_html_e( 'Total', 'learnpress' ); ?></th>
109 - <td><?php echo esc_html( $order->get_formatted_order_total() ); ?></td>
110 - </tr>
111 - </tfoot>
112 -</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>
113 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>
114 125 <p>
115 126 <strong><?php echo esc_html__( 'Order key:', 'learnpress' ); ?></strong>
116 127 <?php echo esc_html( $order->get_order_key() ); ?>
117 128 </p>