| @@ -3,11 +3,14 @@ | ||
| 3 | 3 | * Admin view for displaying details of an order. |
| 4 | 4 | * |
| 5 | 5 | * @author ThimPress (Nhamdv) |
| 6 | 6 | * @package LearnPress/Admin/Views |
| 7 | - * @version 4.0.0 | |
| 7 | + * @version 4.0.5 | |
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | +use LearnPress\Helpers\LPDateTime; | |
| 11 | +use LearnPress\Models\OrderPostModel; | |
| 12 | + | |
| 10 | 13 | if ( isset( $order_items ) ) { |
| 11 | 14 | $currency_symbol = learn_press_get_currency_symbol( $order_items->currency ); |
| 12 | 15 | } else { |
| 13 | 16 | $currency_symbol = learn_press_get_currency_symbol(); |
| @@ -16,11 +19,24 @@ | ||
| 16 | 19 | if ( ! isset( $order ) || ! ( $order instanceof LP_Order ) ) { |
| 17 | 20 | return; |
| 18 | 21 | } |
| 19 | 22 | |
| 20 | -$post = $order->get_post(); | |
| 21 | -$method_title = $order->get_payment_method_title(); | |
| 22 | -$user_ip = $order->get_user_ip_address(); | |
| 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 ); | |
| 23 | 39 | ?> |
| 24 | 40 | |
| 25 | 41 | <div id="learn-press-order" class="order-details"> |
| 26 | 42 | <div class="order-data"> |
| @@ -26,8 +42,11 @@ | ||
| 26 | 42 | <div class="order-data"> |
| 27 | 43 | <h3 class="order-data-number"><?php echo sprintf( __( 'Order %s', 'learnpress' ), $order->get_order_number() ); ?></h3> |
| 28 | 44 | <div class="order-data-field payment-method-title"> |
| 29 | 45 | <?php |
| 46 | + if ( $order->is_manual() ) { | |
| 47 | + printf( '<strong>%s</strong>', __( 'Created manually', 'learnpress' ) ); | |
| 48 | + } | |
| 30 | 49 | if ( $method_title && $user_ip ) { |
| 31 | 50 | printf( 'Pay via <strong>%s</strong> at <strong>%s</strong>', $method_title, $user_ip ); |
| 32 | 51 | } elseif ( $method_title ) { |
| 33 | 52 | printf( 'Pay via <strong>%s</strong>', $method_title ); |
| @@ -43,34 +62,48 @@ | ||
| 43 | 62 | <label><?php esc_html_e( 'Date created:', 'learnpress' ); ?></label> |
| 44 | 63 | |
| 45 | 64 | <?php learn_press_touch_time( true, 1 ); ?> |
| 46 | 65 | |
| 47 | - <input type="hidden" name="aa" value="<?php echo gmdate( 'Y', $order->get_order_date( 'timestamp' ) ); ?>"> | |
| 48 | - <input type="hidden" name="mm" value="<?php echo gmdate( 'm', $order->get_order_date( 'timestamp' ) ); ?>"> | |
| 49 | - <input type="hidden" name="jj" value="<?php echo gmdate( 'd', $order->get_order_date( 'timestamp' ) ); ?>"> | |
| 50 | - <input type="hidden" name="ss" value="<?php echo gmdate( 's', $order->get_order_date( 'timestamp' ) ); ?>"> | |
| 51 | - | |
| 52 | - <input type="text" class="order-date date-picker-backendorder" name="order-date" pattern="[0-9]{4}-(0[1-9]|1[012])-(0[1-9]|1[0-9]|2[0-9]|3[01])" value="<?php echo esc_attr( $order->get_order_date( 'd' ) ); ?>"> | |
| 66 | + <input type="date" class="order-date" name="order-date" | |
| 67 | + value="<?php echo esc_attr( $lpDateTime->format( 'Y-m-d', 'gmt_to_local' ) ); ?>"> | |
| 53 | 68 | @ |
| 54 | - <input type="number" class="order-hour" name="hh" min="0" max="23" value="<?php echo esc_attr( $order->get_order_date( 'h' ) ); ?>"> | |
| 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' ) ); ?>"> | |
| 55 | 71 | : |
| 56 | - <input type="number" class="order-minute" name="mn" min="0" max="59" value="<?php echo esc_attr( $order->get_order_date( 'm' ) ); ?>"> | |
| 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 --> | |
| 57 | 83 | </div> |
| 58 | 84 | |
| 59 | - <div class="order-data-field order-data-status <?php echo sanitize_title( $order->post_status ); ?>"> | |
| 85 | + <div class="order-data-field order-data-status <?php echo sanitize_title( $order->get_post_status() ); ?>"> | |
| 60 | 86 | <label><?php esc_html_e( 'Status:', 'learnpress' ); ?></label> |
| 61 | - <select name="order-status" data-status="<?php echo 'lp-' . $order->get_status(); ?>"> | |
| 87 | + <select name="order-status" data-status="<?php echo $oderPostModel->post_status; ?>"> | |
| 62 | 88 | <?php |
| 63 | - $statuses = learn_press_get_order_statuses(); | |
| 64 | - foreach ( $statuses as $status => $status_name ) { | |
| 65 | - echo '<option data-desc="' . esc_attr( _learn_press_get_order_status_description( $status ) ) . '" value="' . esc_attr( $status ) . '" ' . selected( $status, 'lp-' . $order->get_status(), false ) . '>' . esc_html( $status_name ) . '</option>'; | |
| 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 | |
| 66 | 98 | } |
| 67 | 99 | ?> |
| 68 | 100 | </select> |
| 69 | 101 | |
| 70 | - <?php if ( $order->get_status() === 'completed' ) : ?> | |
| 102 | + <?php if ( $oderPostModel->post_status === OrderPostModel::STATUS_COMPLETED ) : ?> | |
| 71 | 103 | <div> |
| 72 | - <div style="padding: 10px 18px; margin-top: 10px; border: 2px solid #d80000; border-radius: 4px; display: inline-block;"> | |
| 104 | + <div | |
| 105 | + style="padding: 10px 18px; margin-top: 10px; border: 2px solid #d80000; border-radius: 4px; display: inline-block;"> | |
| 73 | 106 | <span class="dashicons dashicons-warning" style="color:#d80000"></span> |
| 74 | 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' ); ?> |
| 75 | 108 | </div> |
| 76 | 109 | </div> |
| @@ -78,58 +111,95 @@ | ||
| 78 | 111 | </div> |
| 79 | 112 | |
| 80 | 113 | <div class="order-data-field order-data-user"> |
| 81 | 114 | <div class="order-users"> |
| 82 | - <?php if ( $order->is_multi_users() ) : ?> | |
| 83 | - <label><?php esc_html_e( 'Customers:', 'learnpress' ); ?></label> | |
| 84 | - <ul id="list-users" class="advanced-list <?php echo esc_attr( $order->get_status() === 'completed' ? 'locked' : '' ); ?>"> | |
| 85 | - </ul> | |
| 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 | + ]; | |
| 86 | 134 | |
| 87 | - <?php if ( 'pending' === $order->get_status() ) : ?> | |
| 88 | - <a href="" class="change-user" data-multiple="yes"><?php esc_html_e( 'Add multiple users', 'learnpress' ); ?></a> | |
| 89 | - <?php endif; ?> | |
| 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 | + ); | |
| 90 | 148 | |
| 91 | - <?php else : ?> | |
| 149 | + $select_field->id = 'order-customer'; | |
| 92 | 150 | |
| 93 | - <label><?php esc_html_e( 'Customer:', 'learnpress' ); ?></label> | |
| 94 | - <?php | |
| 95 | - $user_email = $order->get_user( 'email' ); | |
| 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 | + } | |
| 96 | 176 | |
| 97 | - if ( $user_email ) { | |
| 98 | - printf( '%s (%s) ', $order->get_customer_name(), $order->get_user( 'email' ) ); | |
| 99 | - | |
| 100 | - if ( $order->get_user_id( 'edit' ) ) { | |
| 101 | - printf( '<a href="%s">%s</a>', esc_url_raw( add_query_arg( 'user_id', absint( $order->get_user_id( 'edit' ) ), admin_url( 'user-edit.php' ) ) ), esc_html__( 'Profile', 'learnpress' ) ); | |
| 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 | + } | |
| 102 | 189 | } |
| 103 | - } else { | |
| 104 | - echo wp_kses_post( $order->get_customer_name() ); | |
| 105 | - } | |
| 106 | - ?> | |
| 107 | - | |
| 108 | - <input type="hidden" name="order-customer" id="order-customer" value="<?php echo esc_attr( $order->get_user( 'id' ) ); ?>"/> | |
| 109 | - | |
| 110 | - <?php if ( 'pending' === $order->get_status() ) : ?> | |
| 111 | - <?php echo ' |'; ?> | |
| 112 | - <a href="" class="change-user"><?php esc_html_e( 'Change', 'learnpress' ); ?></a> | |
| 113 | - <?php endif; ?> | |
| 114 | - <?php endif; ?> | |
| 115 | - | |
| 116 | - <?php if ( $order->get_post_status() == 'auto-draft' ) : ?> | |
| 117 | - <?php esc_html_e( '- Or -', 'learnpress' ); ?> | |
| 118 | - <a href="" class="change-user" data-multiple="yes"><?php esc_html_e( 'Add multiple users', 'learnpress' ); ?></a> | |
| 119 | - <?php endif; ?> | |
| 120 | - | |
| 121 | - <?php | |
| 122 | - if ( 'pending' !== $order->get_status() ) { | |
| 123 | - echo '<p class="description">'; | |
| 124 | - esc_html_e( 'In order to change the order user, please change the order status to \'Pending\'.', 'learnpress' ); | |
| 125 | - echo '</p>'; | |
| 126 | - | |
| 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 | + } | |
| 127 | 200 | } |
| 128 | - | |
| 129 | - //learn_press_admin_view( 'meta-boxes/order/child-order', array( 'order' => $order ) ); | |
| 130 | 201 | ?> |
| 131 | - | |
| 132 | 202 | </div> |
| 133 | 203 | </div> |
| 134 | 204 | |
| 135 | 205 | <div class="order-data-field order-data-key"> |
| @@ -136,8 +206,10 @@ | ||
| 136 | 206 | <label><?php esc_html_e( 'Order key:', 'learnpress' ); ?></label> |
| 137 | 207 | <?php echo esc_html( $order->get_order_key() ); ?> |
| 138 | 208 | </div> |
| 139 | 209 | |
| 210 | + <?php learn_press_admin_order_refund_request_panel( $order ); ?> | |
| 211 | + | |
| 140 | 212 | <?php do_action( 'lp/admin/order/detail/after-order-key', $order ); ?> |
| 141 | 213 | |
| 142 | 214 | <div class="order-data-field order-data-note"> |
| 143 | 215 | <?php $note = $post->post_excerpt; ?> |
| @@ -146,127 +218,35 @@ | ||
| 146 | 218 | <p class="order-note description"><?php echo wp_kses_post( $note ); ?></p> |
| 147 | 219 | <?php endif; ?> |
| 148 | 220 | </div> |
| 149 | 221 | </div> |
| 150 | - | |
| 151 | - <div class="order-items"> | |
| 152 | - <table class="list-order-items"> | |
| 153 | - <thead> | |
| 154 | - <tr> | |
| 155 | - <th class="column-name"><?php esc_html_e( 'Item', 'learnpress' ); ?></th> | |
| 156 | - <th class="column-price"><?php esc_html_e( 'Cost', 'learnpress' ); ?></th> | |
| 157 | - <th class="column-quantity"><?php esc_html_e( 'Quantity', 'learnpress' ); ?></th> | |
| 158 | - <th class="column-total align-right"><?php esc_html_e( 'Total', 'learnpress' ); ?></th> | |
| 159 | - </tr> | |
| 160 | - </thead> | |
| 161 | - | |
| 162 | - <tbody> | |
| 163 | - <?php $items = $order->get_items(); ?> | |
| 164 | - | |
| 165 | - <?php if ( $items ) : ?> | |
| 166 | - <?php foreach ( $items as $item ) : ?> | |
| 167 | - <?php include learn_press_get_admin_view( 'meta-boxes/order/order-item.php' ); ?> | |
| 168 | - <?php endforeach; ?> | |
| 169 | - <?php endif; ?> | |
| 170 | - | |
| 171 | - <tr class="no-order-items<?php echo esc_attr( $items ? ' hide-if-js' : '' ); ?>"> | |
| 172 | - <td colspan="4"><?php esc_html_e( 'There are no order items', 'learnpress' ); ?></td> | |
| 173 | - </tr> | |
| 174 | - </tbody> | |
| 175 | - | |
| 176 | - <tfoot> | |
| 177 | - <tr> | |
| 178 | - <td colspan="2"></td> | |
| 179 | - <td colspan="2"></td> | |
| 180 | - </tr> | |
| 181 | - <tr class="row-subtotal"> | |
| 182 | - <td width="300" colspan="3" class="align-right"> | |
| 183 | - <?php esc_html_e( 'Subtotal:', 'learnpress' ); ?> | |
| 184 | - </td> | |
| 185 | - <td width="100" class="align-right"> | |
| 186 | - <span class="order-subtotal"> | |
| 187 | - <?php echo learn_press_format_price( $order->order_subtotal, $currency_symbol ); ?> | |
| 188 | - </span> | |
| 189 | - </td> | |
| 190 | - </tr> | |
| 191 | - <tr class="row-total"> | |
| 192 | - <td class="align-right" colspan="3"> | |
| 193 | - <?php esc_html_e( 'Total:', 'learnpress' ); ?> | |
| 194 | - </td> | |
| 195 | - <td class="align-right total"> | |
| 196 | - <span class="order-total"> | |
| 197 | - <?php echo learn_press_format_price( $order->order_total, $currency_symbol ); ?> | |
| 198 | - </span> | |
| 199 | - </td> | |
| 200 | - </tr> | |
| 201 | - <tr> | |
| 202 | - <td colspan="2"></td> | |
| 203 | - <td colspan="2" style="border-bottom: 1px dashed #DDD;"></td> | |
| 204 | - </tr> | |
| 205 | - <tr> | |
| 206 | - <td class="align-right" colspan="4" style="border-top: 1px solid #DDD;"> | |
| 207 | - <?php if ( 'pending' === $order->get_status() ) { ?> | |
| 208 | - <button class="button" type="button" id="learn-press-add-order-item"> | |
| 209 | - <?php esc_html_e( 'Add item(s)', 'learnpress' ); ?> | |
| 210 | - </button> | |
| 211 | - <?php | |
| 212 | - } else { | |
| 213 | - echo '<p class="description">'; | |
| 214 | - esc_html_e( 'In order to change the order item, please change the order status to \'Pending\'.', 'learnpress' ); | |
| 215 | - echo '</p>'; | |
| 216 | - } | |
| 217 | - ?> | |
| 218 | - </td> | |
| 219 | - </tr> | |
| 220 | - </tfoot> | |
| 221 | - </table> | |
| 222 | - </div> | |
| 222 | + <?php do_action( 'learn-press/admin/order-details/items/layout', $order ); ?> | |
| 223 | 223 | </div> |
| 224 | 224 | |
| 225 | -<script type="text/html" id="tmpl-order-data-user"> | |
| 226 | - <# if(!data.multiple){ #> | |
| 227 | - <div class="order-data-field order-data-user"> | |
| 228 | - <label><?php esc_html_e( 'Customer', 'learnpress' ); ?></label> | |
| 229 | - <div class="order-users"> | |
| 230 | - {{data.name}} | |
| 231 | - <input type="hidden" name="order-customer" id="order-customer" value="{{data.id}}"> | |
| 232 | - </div> | |
| 233 | - <a href="" class="change-user"><?php esc_html_e( 'Change', 'learnpress' ); ?></a> | |
| 234 | - </div> | |
| 235 | - <# }else{ #> | |
| 236 | - <div class="order-data-field order-data-user"> | |
| 237 | - <label><?php esc_html_e( 'Customer', 'learnpress' ); ?></label> | |
| 238 | - <div class="order-users"> | |
| 239 | - <ul id="list-users" class="advanced-list <?php echo esc_attr( $order->get_status() === 'completed' ? 'locked' : '' ); ?>"></ul> | |
| 240 | - </div> | |
| 241 | - <a href="" class="change-user" data-multiple="yes"><?php esc_html_e( 'Add multiple users', 'learnpress' ); ?></a> | |
| 242 | - </div> | |
| 243 | - <# } #> | |
| 244 | -</script> | |
| 245 | - | |
| 246 | -<script type="text/html" id="tmpl-order-advanced-list-item"> | |
| 247 | - <li data-id="{{id}}"> | |
| 248 | - <span class="remove-item"></span><span>{{text}}</span> | |
| 249 | - <input type="hidden" name="order-customer[]" value="{{id}}"> | |
| 250 | - </li> | |
| 251 | -</script> | |
| 252 | - | |
| 253 | 225 | <?php |
| 254 | -$assets = learn_press_admin_assets(); | |
| 226 | +/*$assets = LP_Admin_Assets::instance(); | |
| 255 | 227 | $assets->add_localize( 'learn-press-meta-box-order', 'users', $order->get_user_data() ); |
| 256 | 228 | $assets->add_localize( 'learn-press-meta-box-order', 'userTextFormat', '{{display_name}} ({{email}})' ); |
| 257 | 229 | |
| 258 | 230 | wp_enqueue_script( 'jquery-ui-datepicker' ); |
| 259 | -wp_enqueue_style( 'jquery-ui' ); | |
| 231 | +wp_enqueue_style( 'jquery-ui' );*/ | |
| 260 | 232 | ?> |
| 261 | 233 | |
| 262 | 234 | <script type="text/html" id="tmpl-learn-press-modal-add-order-courses"> |
| 263 | - <div id="learn-press-modal-add-order-courses" class="lp-modal-search" data-nonce="<?php echo wp_create_nonce( 'add_item_to_order' ); ?>"> | |
| 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' ); ?>"> | |
| 264 | 237 | <div class="lp-search-items"> |
| 265 | - <input type="text" id="learn-press-search-item-term" data-nonce="<?php echo wp_create_nonce( 'search_item_term' ); ?>" name="lp-item-name" placeholder="<?php esc_html_e( 'Type here to search for the course', 'learnpress' ); ?>"/> | |
| 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' ); ?>"/> | |
| 266 | 241 | </div> |
| 267 | 242 | <ul id="learn-press-courses-result"> |
| 268 | - <li class="lp-search-no-results hide-if-js" data-id="0"><?php esc_html_e( 'No results', 'learnpress' ); ?></li> | |
| 243 | + <li class="lp-search-no-results hide-if-js" | |
| 244 | + data-id="0"><?php esc_html_e( 'No results', 'learnpress' ); ?> | |
| 245 | + </li> | |
| 269 | 246 | </ul> |
| 270 | - <button class="lp-close-lightbox button" onclick="LP.MessageBox.hide();"><?php esc_html_e( 'Close', 'learnpress' ); ?></button> | |
| 247 | + <button class="lp-close-lightbox button" | |
| 248 | + onclick="LP.MessageBox.hide();"> | |
| 249 | + <?php esc_html_e( 'Close', 'learnpress' ); ?> | |
| 250 | + </button> | |
| 271 | 251 | </div> |
| 272 | 252 | </script> |