| @@ -2,12 +2,14 @@ | ||
| 2 | 2 | /** |
| 3 | 3 | * Display single row of order items. |
| 4 | 4 | * |
| 5 | 5 | * @author Nhamdv <4.0.0> |
| 6 | - * @version 4.0.0 | |
| 6 | + * @version 4.0.1 | |
| 7 | 7 | */ |
| 8 | - | |
| 9 | -if ( ! isset( $item ) ) { | |
| 8 | +/** | |
| 9 | + * @var LP_Order $order | |
| 10 | + */ | |
| 11 | +if ( ! isset( $item ) || ! isset( $order ) ) { | |
| 10 | 12 | return; |
| 11 | 13 | } |
| 12 | 14 | ?> |
| 13 | 15 | |
| @@ -13,10 +15,10 @@ | ||
| 13 | 15 | |
| 14 | 16 | <?php if ( ! empty( $item['course_id'] ) ) { ?> |
| 15 | 17 | <tr class="order-item-row" data-item_id="<?php echo esc_attr( $item['id'] ); ?>" data-id="<?php echo esc_attr( $item['course_id'] ); ?>" data-remove_nonce="<?php echo wp_create_nonce( 'remove_order_item' ); ?>"> |
| 16 | 18 | <td class="column-name"> |
| 17 | - <?php if ( isset( $order ) && 'pending' === $order->get_status() ) : ?> | |
| 18 | - <a class="remove-order-item learn-press-tooltip" href="" data-tooltip="<?php esc_attr_e( 'Delete item', 'learnpress' ); ?>"> | |
| 19 | + <?php if ( $order->is_manual() && $order->get_status() === LP_ORDER_PENDING ) : ?> | |
| 20 | + <a class="remove-order-item" href="#"> | |
| 19 | 21 | <span class="dashicons dashicons-no-alt"></span> |
| 20 | 22 | </a> |
| 21 | 23 | <?php endif; ?> |
| 22 | 24 | |
| @@ -22,9 +24,9 @@ | ||
| 22 | 24 | |
| 23 | 25 | <?php do_action( 'learn_press/before_order_details_item_title', $item ); ?> |
| 24 | 26 | |
| 25 | 27 | <a href="<?php echo apply_filters( 'learn_press/order_item_link', get_the_permalink( $item['course_id'] ), $item ); ?>"> |
| 26 | - <?php echo apply_filters( 'learn_press/order_item_name', esc_html( $item['name'] ), $item ); ?> | |
| 28 | + <?php echo apply_filters( 'learn_press/order_item_name', esc_html( $item['name'] ), $item, $order ); ?> | |
| 27 | 29 | </a> |
| 28 | 30 | |
| 29 | 31 | <?php do_action( 'learn_press/after_order_details_item_title', $item ); ?> |
| 30 | 32 | </td> |
| @@ -42,7 +44,7 @@ | ||
| 42 | 44 | </tr> |
| 43 | 45 | |
| 44 | 46 | <?php |
| 45 | 47 | } else { |
| 46 | - do_action( 'learn-press/order-item-not-course', $item ); | |
| 48 | + do_action( 'learn-press/order-item-not-course', $item, $order ); | |
| 47 | 49 | } |
| 48 | 50 | ?> |