PluginProbe
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses / 4.2.0
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses v4.2.0
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 / checkout / review-order.php

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

121 lines 3.8 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 reviewing before placing order.
4 *
5 * This template can be overridden by copying it to yourtheme/learnpress/checkout/review-order.php.
6 *
7 * @author ThimPress
8 * @package Learnpress/Templates
9 * @version 4.0.1
10 */
11
12 defined( 'ABSPATH' ) || exit();
13
14 // $cart = learn_press_get_checkout_cart();
15
16 /**
17 * @var LP_Cart $cart
18 */
19 if ( ! isset( $cart ) || ! $cart ) {
20 return;
21 }
22 ?>
23
24 <div id="checkout-order" class="lp-checkout-block right">
25
26 <h4><?php esc_html_e( 'Your order', 'learnpress' ); ?></h4>
27
28 <div class="lp-checkout-order__inner">
29 <table>
30 <tbody>
31
32 <?php
33 do_action( 'learn_press_review_order_before_cart_contents' );
34 do_action( 'learn-press/review-order/before-cart-contents' );
35
36 $items = $cart->get_items();
37
38 if ( $items ) {
39 foreach ( $items as $cart_item_key => $cart_item ) {
40 $cart_item = apply_filters( 'learn-press/review-order/cart-item', $cart_item );
41 $item_id = $cart_item['item_id'];
42 $_course = apply_filters( 'learn-press/review-order/cart-item-product', learn_press_get_course( $item_id ), $cart_item );
43
44 if ( $_course && 0 < $cart_item['quantity'] ) {
45 ?>
46 <tr class="<?php echo esc_attr( apply_filters( 'learn-press/review-order/cart-item-class', 'cart-item', $cart_item, $cart_item_key ) ); ?>">
47 <?php
48 do_action( 'learn_press_review_order_before_cart_item', $cart_item );
49 do_action( 'learn-press/review-order/before-cart-item', $cart_item, $cart_item_key );
50 ?>
51
52 <td class="course-thumbnail">
53 <?php echo wp_kses_post( $_course->get_image() ); ?>
54 </td>
55 <td class="course-name">
56 <a href="<?php echo esc_url_raw( apply_filters( 'learn-press/review-order/cart-item-link', get_the_permalink( $item_id ), $cart_item ) ); ?>">
57 <?php echo wp_kses_post( apply_filters( 'learn-press/review-order/cart-item-name', $_course->get_title(), $cart_item, $cart_item_key ) ); ?>
58 </a>
59
60 <?php
61 if ( $cart_item['quantity'] > 1 ) {
62 echo wp_kses_post( apply_filters( 'learn-press/review-order/cart-item-quantity', ' <strong class="course-quantity">' . sprintf( '&times; %s', $cart_item['quantity'] ) . '</strong>', $cart_item, $cart_item_key ) );
63 }
64 ?>
65 </td>
66 <td class="course-total col-number">
67 <?php echo esc_html( apply_filters( 'learn-press/review-order/cart-item-subtotal', $cart->get_item_subtotal( $_course, $cart_item['quantity'] ), $cart_item, $cart_item_key ) ); ?>
68 </td>
69
70 <?php
71 do_action( 'learn-press/review-order/after-cart-item', $cart_item, $cart_item_key );
72 do_action( 'learn_press_review_order_after_cart_item', $cart_item );
73 ?>
74 </tr>
75
76 <?php
77 }
78 }
79 }
80
81 do_action( 'learn-press/review-order/after-cart-contents' );
82 do_action( 'learn_press_review_order_after_cart_contents' );
83 ?>
84
85 </tbody>
86
87 <tfoot>
88 <tr class="cart-subtotal">
89
90 <?php do_action( 'learn-press/review-order/before-subtotal-row' ); ?>
91
92 <th colspan="2"><?php _e( 'Subtotal', 'learnpress' ); ?></th>
93 <td class="col-number"><?php echo esc_html( $cart->get_subtotal() ); ?></td>
94
95 <?php do_action( 'learn-press/review-order/after-subtotal-row' ); ?>
96 </tr>
97
98 <?php
99 do_action( 'learn_press_review_order_before_order_total' );
100 do_action( 'learn-press/review-order/before-order-total' );
101 ?>
102
103 <tr class="order-total">
104 <?php do_action( 'learn-press/review-order/before-total-row' ); ?>
105
106 <th colspan="2"><?php esc_html_e( 'Total', 'learnpress' ); ?></th>
107 <td class="col-number"><?php echo esc_html( $cart->get_total() ); ?></td>
108
109 <?php do_action( 'learn-press/review-order/after-total-row' ); ?>
110 </tr>
111
112 <?php
113 do_action( 'learn-press/review-order/after-order-total' );
114 do_action( 'learn_press_review_order_after_order_total' );
115 ?>
116
117 </tfoot>
118 </table>
119 </div>
120 </div>
121