| @@ -1,235 +1,252 @@ | ||
| 1 | -<?php | |
| 2 | -/** | |
| 3 | - * Admin view for displaying details of an order. | |
| 4 | - * | |
| 5 | - * @author ThimPress (Nhamdv) | |
| 6 | - * @package LearnPress/Admin/Views | |
| 7 | - * @version 4.0.4 | |
| 8 | - */ | |
| 9 | - | |
| 10 | -if ( isset( $order_items ) ) { | |
| 11 | - $currency_symbol = learn_press_get_currency_symbol( $order_items->currency ); | |
| 12 | -} else { | |
| 13 | - $currency_symbol = learn_press_get_currency_symbol(); | |
| 14 | -} | |
| 15 | - | |
| 16 | -if ( ! isset( $order ) || ! ( $order instanceof LP_Order ) ) { | |
| 17 | - return; | |
| 18 | -} | |
| 19 | - | |
| 20 | -$post = $order->get_post(); | |
| 21 | -$method_title = $order->get_payment_method_title(); | |
| 22 | -$user_ip = $order->get_user_ip_address(); | |
| 23 | -$user_ids = $order->get_user_id(); | |
| 24 | -?> | |
| 25 | - | |
| 26 | -<div id="learn-press-order" class="order-details"> | |
| 27 | - <div class="order-data"> | |
| 28 | - <h3 class="order-data-number"><?php echo sprintf( __( 'Order %s', 'learnpress' ), $order->get_order_number() ); ?></h3> | |
| 29 | - <div class="order-data-field payment-method-title"> | |
| 30 | - <?php | |
| 31 | - if ( $order->is_manual() ) { | |
| 32 | - printf( '<strong>%s</strong>', __( 'Created manually', 'learnpress' ) ); | |
| 33 | - } | |
| 34 | - if ( $method_title && $user_ip ) { | |
| 35 | - printf( 'Pay via <strong>%s</strong> at <strong>%s</strong>', $method_title, $user_ip ); | |
| 36 | - } elseif ( $method_title ) { | |
| 37 | - printf( 'Pay via <strong>%s</strong>', $method_title ); | |
| 38 | - } elseif ( $user_ip ) { | |
| 39 | - printf( 'Customer IP <strong>%s</strong>', $user_ip ); | |
| 40 | - } | |
| 41 | - ?> | |
| 42 | - </div> | |
| 43 | - | |
| 44 | - <h3 class="order-data-heading"><?php esc_html_e( 'Order details', 'learnpress' ); ?></h3> | |
| 45 | - | |
| 46 | - <div class="order-data-field order-data-date"> | |
| 47 | - <label><?php esc_html_e( 'Date created:', 'learnpress' ); ?></label> | |
| 48 | - | |
| 49 | - <?php learn_press_touch_time( true, 1 ); ?> | |
| 50 | - | |
| 51 | - <input type="date" class="order-date" name="order-date" | |
| 52 | - value="<?php echo esc_attr( $order->get_order_date( 'd' ) ); ?>"> | |
| 53 | - @ | |
| 54 | - <input type="number" class="order-hour" name="order-hour" min="0" max="23" | |
| 55 | - value="<?php echo esc_attr( $order->get_order_date( 'h' ) ); ?>"> | |
| 56 | - : | |
| 57 | - <input type="number" class="order-minute" name="order-minute" min="0" max="59" | |
| 58 | - value="<?php echo esc_attr( $order->get_order_date( 'm' ) ); ?>"> | |
| 59 | - | |
| 60 | - <!-- Hidden fields for date only for default save post of Wordpress --> | |
| 61 | - <input type="hidden" name="aa" value="<?php echo gmdate( 'Y', $order->get_order_date( 'timestamp' ) ); ?>"> | |
| 62 | - <input type="hidden" name="mm" value="<?php echo gmdate( 'm', $order->get_order_date( 'timestamp' ) ); ?>"> | |
| 63 | - <input type="hidden" name="jj" value="<?php echo gmdate( 'd', $order->get_order_date( 'timestamp' ) ); ?>"> | |
| 64 | - <input type="hidden" name="ss" value="<?php echo gmdate( 's', $order->get_order_date( 'timestamp' ) ); ?>"> | |
| 65 | - <input type="hidden" name="hh" value="<?php echo gmdate( 'h', $order->get_order_date( 'h' ) ); ?>"> | |
| 66 | - <input type="hidden" name="mn" value="<?php echo gmdate( 'm', $order->get_order_date( 'm' ) ); ?>"> | |
| 67 | - <!-- Hidden fields for date only for default save post of Wordpress --> | |
| 68 | - </div> | |
| 69 | - | |
| 70 | - <div class="order-data-field order-data-status <?php echo sanitize_title( $order->get_post_status() ); ?>"> | |
| 71 | - <label><?php esc_html_e( 'Status:', 'learnpress' ); ?></label> | |
| 72 | - <select name="order-status" data-status="<?php echo 'lp-' . $order->get_status(); ?>"> | |
| 73 | - <?php | |
| 74 | - $statuses = LP_Order::get_order_statuses(); | |
| 75 | - foreach ( $statuses as $status => $status_name ) { | |
| 76 | - ?> | |
| 77 | - <option data-desc="<?php echo esc_attr( _learn_press_get_order_status_description( $status ) ); ?>" | |
| 78 | - value="<?php echo esc_attr( $status ); ?>" | |
| 79 | - <?php echo selected( $status, 'lp-' . $order->get_status(), false ); ?>> | |
| 80 | - <?php echo esc_html( LP_Order::get_status_label( $status_name ) ); ?> | |
| 81 | - </option>; | |
| 82 | - <?php | |
| 83 | - } | |
| 84 | - ?> | |
| 85 | - </select> | |
| 86 | - | |
| 87 | - <?php if ( $order->get_status() === 'completed' ) : ?> | |
| 88 | - <div> | |
| 89 | - <div | |
| 90 | - style="padding: 10px 18px; margin-top: 10px; border: 2px solid #d80000; border-radius: 4px; display: inline-block;"> | |
| 91 | - <span class="dashicons dashicons-warning" style="color:#d80000"></span> | |
| 92 | - <?php esc_html_e( 'When the Status is changed to "Pending", "Cancelled", or "Failed" all courses, lessons, quizzes, and other progress are deleted!', 'learnpress' ); ?> | |
| 93 | - </div> | |
| 94 | - </div> | |
| 95 | - <?php endif; ?> | |
| 96 | - </div> | |
| 97 | - | |
| 98 | - <div class="order-data-field order-data-user"> | |
| 99 | - <div class="order-users"> | |
| 100 | - <label><?php esc_html_e( 'Customers:', 'learnpress' ); ?></label> | |
| 101 | - <?php | |
| 102 | - if ( LP_ORDER_PENDING === $order->get_status() && $order->is_manual() ) { | |
| 103 | - $data_struct = [ | |
| 104 | - 'urlApi' => get_rest_url( null, 'lp/v1/admin/tools/search-user' ), | |
| 105 | - 'dataType' => 'users', | |
| 106 | - 'keyGetValue' => [ | |
| 107 | - 'value' => 'ID', | |
| 108 | - 'text' => '{{display_name}}(#{{ID}}) - {{user_email}}', | |
| 109 | - 'key_render' => [ | |
| 110 | - 'display_name' => 'display_name', | |
| 111 | - 'user_email' => 'user_email', | |
| 112 | - 'ID' => 'ID', | |
| 113 | - ], | |
| 114 | - ], | |
| 115 | - 'setting' => [ | |
| 116 | - 'placeholder' => esc_html__( 'Choose User', 'learnpress' ), | |
| 117 | - ], | |
| 118 | - ]; | |
| 119 | - | |
| 120 | - $select_field = new LP_Meta_Box_Select_Field( | |
| 121 | - '', | |
| 122 | - '', | |
| 123 | - '', | |
| 124 | - array( | |
| 125 | - 'options' => array(), | |
| 126 | - 'style' => 'min-width:200px;', | |
| 127 | - 'tom_select' => true, | |
| 128 | - 'multiple' => true, | |
| 129 | - 'custom_attributes' => [ 'data-struct' => htmlentities2( json_encode( $data_struct ) ) ], | |
| 130 | - 'data-saved' => $user_ids, | |
| 131 | - ) | |
| 132 | - ); | |
| 133 | - | |
| 134 | - $select_field->id = 'order-customer'; | |
| 135 | - | |
| 136 | - $select_field->output( $order->get_id() ); | |
| 137 | - } else { | |
| 138 | - ?> | |
| 139 | - <div class="advanced-list"> | |
| 140 | - <div class="ts-control"> | |
| 141 | - <?php | |
| 142 | - $order_user_id = $order->get_user_id(); | |
| 143 | - if ( ! $order->is_manual() && ! is_array( $order_user_id ) && $order->is_guest() ) { | |
| 144 | - printf( | |
| 145 | - '<li> | |
| 146 | - <div class="item">%s</div> | |
| 147 | - </li>', | |
| 148 | - sprintf( '%s (%s)', $order->get_checkout_email(), __( 'Guest', 'learnpress' ) ) | |
| 149 | - ); | |
| 150 | - } elseif ( $order->is_manual() && empty( $order->get_users() ) && $order->is_guest() ) { | |
| 151 | - printf( | |
| 152 | - '<li> | |
| 153 | - <div class="item">%s</div> | |
| 154 | - </li>', | |
| 155 | - __( 'No customer', 'learnpress' ) | |
| 156 | - ); | |
| 157 | - } else { | |
| 158 | - if ( ! is_array( $user_ids ) ) { | |
| 159 | - $user_ids = (array) $user_ids; | |
| 160 | - } | |
| 161 | - | |
| 162 | - foreach ( $user_ids as $user_id ) { | |
| 163 | - $user = learn_press_get_user( $user_id ); | |
| 164 | - if ( ! $user ) { | |
| 165 | - continue; | |
| 166 | - } | |
| 167 | - printf( | |
| 168 | - '<li> | |
| 169 | - <div class="item" data-ts-item="">%s</div> | |
| 170 | - </li>', | |
| 171 | - sprintf( '%s (#%d) - %s', $user->get_display_name(), $user->get_id(), $user->get_email() ) | |
| 172 | - ); | |
| 173 | - } | |
| 174 | - } | |
| 175 | - ?> | |
| 176 | - </div> | |
| 177 | - </div> | |
| 178 | - <?php | |
| 179 | - if ( $order->is_manual() ) { | |
| 180 | - printf( | |
| 181 | - '<p class="description">%s</p>', | |
| 182 | - esc_html__( 'In order to change the order user, please change the order status to "Pending".', 'learnpress' ) | |
| 183 | - ); | |
| 184 | - } | |
| 185 | - } | |
| 186 | - ?> | |
| 187 | - </div> | |
| 188 | - </div> | |
| 189 | - | |
| 190 | - <div class="order-data-field order-data-key"> | |
| 191 | - <label><?php esc_html_e( 'Order key:', 'learnpress' ); ?></label> | |
| 192 | - <?php echo esc_html( $order->get_order_key() ); ?> | |
| 193 | - </div> | |
| 194 | - | |
| 195 | - <?php do_action( 'lp/admin/order/detail/after-order-key', $order ); ?> | |
| 196 | - | |
| 197 | - <div class="order-data-field order-data-note"> | |
| 198 | - <?php $note = $post->post_excerpt; ?> | |
| 199 | - <?php if ( ! empty( $note ) ) : ?> | |
| 200 | - <label><?php esc_html_e( 'Customer Note', 'learnpress' ); ?></label> | |
| 201 | - <p class="order-note description"><?php echo wp_kses_post( $note ); ?></p> | |
| 202 | - <?php endif; ?> | |
| 203 | - </div> | |
| 204 | - </div> | |
| 205 | - <?php do_action( 'learn-press/admin/order-details/items/layout', $order ); ?> | |
| 206 | -</div> | |
| 207 | - | |
| 208 | -<?php | |
| 209 | -$assets = LP_Admin_Assets::instance(); | |
| 210 | -$assets->add_localize( 'learn-press-meta-box-order', 'users', $order->get_user_data() ); | |
| 211 | -$assets->add_localize( 'learn-press-meta-box-order', 'userTextFormat', '{{display_name}} ({{email}})' ); | |
| 212 | - | |
| 213 | -wp_enqueue_script( 'jquery-ui-datepicker' ); | |
| 214 | -wp_enqueue_style( 'jquery-ui' ); | |
| 215 | -?> | |
| 216 | - | |
| 217 | -<script type="text/html" id="tmpl-learn-press-modal-add-order-courses"> | |
| 218 | - <div id="learn-press-modal-add-order-courses" class="lp-modal-search" | |
| 219 | - data-nonce="<?php echo wp_create_nonce( 'add_item_to_order' ); ?>"> | |
| 220 | - <div class="lp-search-items"> | |
| 221 | - <input type="text" id="learn-press-search-item-term" | |
| 222 | - data-nonce="<?php echo wp_create_nonce( 'search_item_term' ); ?>" name="lp-item-name" | |
| 223 | - placeholder="<?php esc_html_e( 'Type here to search for the course', 'learnpress' ); ?>"/> | |
| 224 | - </div> | |
| 225 | - <ul id="learn-press-courses-result"> | |
| 226 | - <li class="lp-search-no-results hide-if-js" | |
| 227 | - data-id="0"><?php esc_html_e( 'No results', 'learnpress' ); ?> | |
| 228 | - </li> | |
| 229 | - </ul> | |
| 230 | - <button class="lp-close-lightbox button" | |
| 231 | - onclick="LP.MessageBox.hide();"> | |
| 232 | - <?php esc_html_e( 'Close', 'learnpress' ); ?> | |
| 233 | - </button> | |
| 234 | - </div> | |
| 235 | -</script> | |
| 1 | +<?php | |
| 2 | +/** | |
| 3 | + * Admin view for displaying details of an order. | |
| 4 | + * | |
| 5 | + * @author ThimPress (Nhamdv) | |
| 6 | + * @package LearnPress/Admin/Views | |
| 7 | + * @version 4.0.5 | |
| 8 | + */ | |
| 9 | + | |
| 10 | +use LearnPress\Helpers\LPDateTime; | |
| 11 | +use LearnPress\Models\OrderPostModel; | |
| 12 | + | |
| 13 | +if ( isset( $order_items ) ) { | |
| 14 | + $currency_symbol = learn_press_get_currency_symbol( $order_items->currency ); | |
| 15 | +} else { | |
| 16 | + $currency_symbol = learn_press_get_currency_symbol(); | |
| 17 | +} | |
| 18 | + | |
| 19 | +if ( ! isset( $order ) || ! ( $order instanceof LP_Order ) ) { | |
| 20 | + return; | |
| 21 | +} | |
| 22 | + | |
| 23 | +$post = $order->get_post(); | |
| 24 | +$method_title = $order->get_payment_method_title(); | |
| 25 | +$user_ip = $order->get_user_ip_address(); | |
| 26 | +$user_ids = $order->get_user_id(); | |
| 27 | +$oderPostModel = OrderPostModel::find_by_id( $post->ID, true ); | |
| 28 | +if ( ! $oderPostModel ) { | |
| 29 | + return; | |
| 30 | +} | |
| 31 | + | |
| 32 | +// Check create new Order Manual by WP | |
| 33 | +if ( $oderPostModel->post_date_gmt === '0000-00-00 00:00:00' ) { | |
| 34 | + $convert_post_date_gmt = get_gmt_from_date( $oderPostModel->post_date ); | |
| 35 | + $oderPostModel->post_date_gmt = $convert_post_date_gmt; | |
| 36 | +} | |
| 37 | + | |
| 38 | +$lpDateTime = new LPDateTime( $oderPostModel->post_date_gmt ); | |
| 39 | +?> | |
| 40 | + | |
| 41 | +<div id="learn-press-order" class="order-details"> | |
| 42 | + <div class="order-data"> | |
| 43 | + <h3 class="order-data-number"><?php echo sprintf( __( 'Order %s', 'learnpress' ), $order->get_order_number() ); ?></h3> | |
| 44 | + <div class="order-data-field payment-method-title"> | |
| 45 | + <?php | |
| 46 | + if ( $order->is_manual() ) { | |
| 47 | + printf( '<strong>%s</strong>', __( 'Created manually', 'learnpress' ) ); | |
| 48 | + } | |
| 49 | + if ( $method_title && $user_ip ) { | |
| 50 | + printf( 'Pay via <strong>%s</strong> at <strong>%s</strong>', $method_title, $user_ip ); | |
| 51 | + } elseif ( $method_title ) { | |
| 52 | + printf( 'Pay via <strong>%s</strong>', $method_title ); | |
| 53 | + } elseif ( $user_ip ) { | |
| 54 | + printf( 'Customer IP <strong>%s</strong>', $user_ip ); | |
| 55 | + } | |
| 56 | + ?> | |
| 57 | + </div> | |
| 58 | + | |
| 59 | + <h3 class="order-data-heading"><?php esc_html_e( 'Order details', 'learnpress' ); ?></h3> | |
| 60 | + | |
| 61 | + <div class="order-data-field order-data-date"> | |
| 62 | + <label><?php esc_html_e( 'Date created:', 'learnpress' ); ?></label> | |
| 63 | + | |
| 64 | + <?php learn_press_touch_time( true, 1 ); ?> | |
| 65 | + | |
| 66 | + <input type="date" class="order-date" name="order-date" | |
| 67 | + value="<?php echo esc_attr( $lpDateTime->format( 'Y-m-d', 'gmt_to_local' ) ); ?>"> | |
| 68 | + @ | |
| 69 | + <input type="number" class="order-hour" name="order-hour" min="0" max="23" | |
| 70 | + value="<?php echo esc_attr( $lpDateTime->format( 'H', 'gmt_to_local' ) ); ?>"> | |
| 71 | + : | |
| 72 | + <input type="number" class="order-minute" name="order-minute" min="0" max="59" | |
| 73 | + value="<?php echo esc_attr( $lpDateTime->format( 'i', 'gmt_to_local' ) ); ?>"> | |
| 74 | + | |
| 75 | + <!-- Hidden fields for date only for default save post of WordPress --> | |
| 76 | + <input type="hidden" name="aa" value="<?php echo esc_attr( $lpDateTime->format( 'Y', 'gmt_to_local' ) ); ?>"> | |
| 77 | + <input type="hidden" name="mm" value="<?php echo esc_attr( $lpDateTime->format( 'm', 'gmt_to_local' ) ); ?>"> | |
| 78 | + <input type="hidden" name="jj" value="<?php echo esc_attr( $lpDateTime->format( 'd', 'gmt_to_local' ) ); ?>"> | |
| 79 | + <input type="hidden" name="ss" value="<?php echo esc_attr( $lpDateTime->format( 's', 'gmt_to_local' ) ); ?>"> | |
| 80 | + <input type="hidden" name="hh" value="<?php echo esc_attr( $lpDateTime->format( 'h', 'gmt_to_local' ) ); ?>"> | |
| 81 | + <input type="hidden" name="mn" value="<?php echo esc_attr( $lpDateTime->format( 'i', 'gmt_to_local' ) ); ?>"> | |
| 82 | + <!-- Hidden fields for date only for default save post of WordPress --> | |
| 83 | + </div> | |
| 84 | + | |
| 85 | + <div class="order-data-field order-data-status <?php echo sanitize_title( $order->get_post_status() ); ?>"> | |
| 86 | + <label><?php esc_html_e( 'Status:', 'learnpress' ); ?></label> | |
| 87 | + <select name="order-status" data-status="<?php echo $oderPostModel->post_status; ?>"> | |
| 88 | + <?php | |
| 89 | + $statuses = OrderPostModel::get_order_statuses(); | |
| 90 | + foreach ( $statuses as $status => $status_label ) { | |
| 91 | + ?> | |
| 92 | + <option data-desc="<?php echo esc_attr( _learn_press_get_order_status_description( $status ) ); ?>" | |
| 93 | + value="<?php echo esc_attr( $status ); ?>" | |
| 94 | + <?php echo selected( $status, $oderPostModel->post_status, false ); ?>> | |
| 95 | + <?php echo esc_html( $status_label ); ?> | |
| 96 | + </option>; | |
| 97 | + <?php | |
| 98 | + } | |
| 99 | + ?> | |
| 100 | + </select> | |
| 101 | + | |
| 102 | + <?php if ( $oderPostModel->post_status === OrderPostModel::STATUS_COMPLETED ) : ?> | |
| 103 | + <div> | |
| 104 | + <div | |
| 105 | + style="padding: 10px 18px; margin-top: 10px; border: 2px solid #d80000; border-radius: 4px; display: inline-block;"> | |
| 106 | + <span class="dashicons dashicons-warning" style="color:#d80000"></span> | |
| 107 | + <?php esc_html_e( 'When the Status is changed to "Pending", "Cancelled", or "Failed" all courses, lessons, quizzes, and other progress are deleted!', 'learnpress' ); ?> | |
| 108 | + </div> | |
| 109 | + </div> | |
| 110 | + <?php endif; ?> | |
| 111 | + </div> | |
| 112 | + | |
| 113 | + <div class="order-data-field order-data-user"> | |
| 114 | + <div class="order-users"> | |
| 115 | + <label><?php esc_html_e( 'Customers:', 'learnpress' ); ?></label> | |
| 116 | + <?php | |
| 117 | + if ( OrderPostModel::STATUS_PENDING === $oderPostModel->post_status && $order->is_manual() ) { | |
| 118 | + $data_struct = [ | |
| 119 | + 'urlApi' => get_rest_url( null, 'lp/v1/admin/tools/search-user' ), | |
| 120 | + 'dataType' => 'users', | |
| 121 | + 'keyGetValue' => [ | |
| 122 | + 'value' => 'ID', | |
| 123 | + 'text' => '{{display_name}}(#{{ID}}) - {{user_email}}', | |
| 124 | + 'key_render' => [ | |
| 125 | + 'display_name' => 'display_name', | |
| 126 | + 'user_email' => 'user_email', | |
| 127 | + 'ID' => 'ID', | |
| 128 | + ], | |
| 129 | + ], | |
| 130 | + 'setting' => [ | |
| 131 | + 'placeholder' => esc_html__( 'Choose User', 'learnpress' ), | |
| 132 | + ], | |
| 133 | + ]; | |
| 134 | + | |
| 135 | + $select_field = new LP_Meta_Box_Select_Field( | |
| 136 | + '', | |
| 137 | + '', | |
| 138 | + '', | |
| 139 | + array( | |
| 140 | + 'options' => array(), | |
| 141 | + 'style' => 'min-width:200px;', | |
| 142 | + 'tom_select' => true, | |
| 143 | + 'multiple' => true, | |
| 144 | + 'custom_attributes' => [ 'data-struct' => htmlentities2( json_encode( $data_struct ) ) ], | |
| 145 | + 'data-saved' => $user_ids, | |
| 146 | + ) | |
| 147 | + ); | |
| 148 | + | |
| 149 | + $select_field->id = 'order-customer'; | |
| 150 | + | |
| 151 | + $select_field->output( $order->get_id() ); | |
| 152 | + } else { | |
| 153 | + ?> | |
| 154 | + <div class="advanced-list"> | |
| 155 | + <div class="ts-control"> | |
| 156 | + <?php | |
| 157 | + $order_user_id = $order->get_user_id(); | |
| 158 | + if ( ! $order->is_manual() && ! is_array( $order_user_id ) && $order->is_guest() ) { | |
| 159 | + printf( | |
| 160 | + '<li> | |
| 161 | + <div class="item">%s</div> | |
| 162 | + </li>', | |
| 163 | + sprintf( '%s (%s)', $order->get_checkout_email(), __( 'Guest', 'learnpress' ) ) | |
| 164 | + ); | |
| 165 | + } elseif ( $order->is_manual() && empty( $order->get_users() ) && $order->is_guest() ) { | |
| 166 | + printf( | |
| 167 | + '<li> | |
| 168 | + <div class="item">%s</div> | |
| 169 | + </li>', | |
| 170 | + __( 'No customer', 'learnpress' ) | |
| 171 | + ); | |
| 172 | + } else { | |
| 173 | + if ( ! is_array( $user_ids ) ) { | |
| 174 | + $user_ids = (array) $user_ids; | |
| 175 | + } | |
| 176 | + | |
| 177 | + foreach ( $user_ids as $user_id ) { | |
| 178 | + $user = learn_press_get_user( $user_id ); | |
| 179 | + if ( ! $user ) { | |
| 180 | + continue; | |
| 181 | + } | |
| 182 | + printf( | |
| 183 | + '<li> | |
| 184 | + <div class="item" data-ts-item="">%s</div> | |
| 185 | + </li>', | |
| 186 | + sprintf( '%s (#%d) - %s', $user->get_display_name(), $user->get_id(), $user->get_email() ) | |
| 187 | + ); | |
| 188 | + } | |
| 189 | + } | |
| 190 | + ?> | |
| 191 | + </div> | |
| 192 | + </div> | |
| 193 | + <?php | |
| 194 | + if ( $order->is_manual() ) { | |
| 195 | + printf( | |
| 196 | + '<p class="description">%s</p>', | |
| 197 | + esc_html__( 'In order to change the order user, please change the order status to "Pending".', 'learnpress' ) | |
| 198 | + ); | |
| 199 | + } | |
| 200 | + } | |
| 201 | + ?> | |
| 202 | + </div> | |
| 203 | + </div> | |
| 204 | + | |
| 205 | + <div class="order-data-field order-data-key"> | |
| 206 | + <label><?php esc_html_e( 'Order key:', 'learnpress' ); ?></label> | |
| 207 | + <?php echo esc_html( $order->get_order_key() ); ?> | |
| 208 | + </div> | |
| 209 | + | |
| 210 | + <?php learn_press_admin_order_refund_request_panel( $order ); ?> | |
| 211 | + | |
| 212 | + <?php do_action( 'lp/admin/order/detail/after-order-key', $order ); ?> | |
| 213 | + | |
| 214 | + <div class="order-data-field order-data-note"> | |
| 215 | + <?php $note = $post->post_excerpt; ?> | |
| 216 | + <?php if ( ! empty( $note ) ) : ?> | |
| 217 | + <label><?php esc_html_e( 'Customer Note', 'learnpress' ); ?></label> | |
| 218 | + <p class="order-note description"><?php echo wp_kses_post( $note ); ?></p> | |
| 219 | + <?php endif; ?> | |
| 220 | + </div> | |
| 221 | + </div> | |
| 222 | + <?php do_action( 'learn-press/admin/order-details/items/layout', $order ); ?> | |
| 223 | +</div> | |
| 224 | + | |
| 225 | +<?php | |
| 226 | +/*$assets = LP_Admin_Assets::instance(); | |
| 227 | +$assets->add_localize( 'learn-press-meta-box-order', 'users', $order->get_user_data() ); | |
| 228 | +$assets->add_localize( 'learn-press-meta-box-order', 'userTextFormat', '{{display_name}} ({{email}})' ); | |
| 229 | + | |
| 230 | +wp_enqueue_script( 'jquery-ui-datepicker' ); | |
| 231 | +wp_enqueue_style( 'jquery-ui' );*/ | |
| 232 | +?> | |
| 233 | + | |
| 234 | +<script type="text/html" id="tmpl-learn-press-modal-add-order-courses"> | |
| 235 | + <div id="learn-press-modal-add-order-courses" class="lp-modal-search" | |
| 236 | + data-nonce="<?php echo wp_create_nonce( 'add_item_to_order' ); ?>"> | |
| 237 | + <div class="lp-search-items"> | |
| 238 | + <input type="text" id="learn-press-search-item-term" | |
| 239 | + data-nonce="<?php echo wp_create_nonce( 'search_item_term' ); ?>" name="lp-item-name" | |
| 240 | + placeholder="<?php esc_html_e( 'Type here to search for the course', 'learnpress' ); ?>"/> | |
| 241 | + </div> | |
| 242 | + <ul id="learn-press-courses-result"> | |
| 243 | + <li class="lp-search-no-results hide-if-js" | |
| 244 | + data-id="0"><?php esc_html_e( 'No results', 'learnpress' ); ?> | |
| 245 | + </li> | |
| 246 | + </ul> | |
| 247 | + <button class="lp-close-lightbox button" | |
| 248 | + onclick="LP.MessageBox.hide();"> | |
| 249 | + <?php esc_html_e( 'Close', 'learnpress' ); ?> | |
| 250 | + </button> | |
| 251 | + </div> | |
| 252 | +</script> | |