form-tracking.php
7 years ago
order-again.php
7 years ago
order-details-customer.php
6 years ago
order-details-item.php
6 years ago
order-details.php
6 years ago
order-downloads.php
7 years ago
tracking.php
6 years ago
order-details-item.php
69 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Order Item Details |
| 4 | * |
| 5 | * This template can be overridden by copying it to yourtheme/woocommerce/order/order-details-item.php. |
| 6 | * |
| 7 | * HOWEVER, on occasion WooCommerce will need to update template files and you |
| 8 | * (the theme developer) will need to copy the new files to your theme to |
| 9 | * maintain compatibility. We try to do this as little as possible, but it does |
| 10 | * happen. When this occurs the version of the template file will be bumped and |
| 11 | * the readme will list any important changes. |
| 12 | * |
| 13 | * @see https://docs.woocommerce.com/document/template-structure/ |
| 14 | * @package WooCommerce/Templates |
| 15 | * @version 3.7.0 |
| 16 | */ |
| 17 | |
| 18 | if ( ! defined( 'ABSPATH' ) ) { |
| 19 | exit; |
| 20 | } |
| 21 | |
| 22 | if ( ! apply_filters( 'woocommerce_order_item_visible', true, $item ) ) { |
| 23 | return; |
| 24 | } |
| 25 | ?> |
| 26 | <tr class="<?php echo esc_attr( apply_filters( 'woocommerce_order_item_class', 'woocommerce-table__line-item order_item', $item, $order ) ); ?>"> |
| 27 | |
| 28 | <td class="woocommerce-table__product-name product-name"> |
| 29 | <?php |
| 30 | $is_visible = $product && $product->is_visible(); |
| 31 | $product_permalink = apply_filters( 'woocommerce_order_item_permalink', $is_visible ? $product->get_permalink( $item ) : '', $item, $order ); |
| 32 | |
| 33 | echo apply_filters( 'woocommerce_order_item_name', $product_permalink ? sprintf( '<a href="%s">%s</a>', $product_permalink, $item->get_name() ) : $item->get_name(), $item, $is_visible ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
| 34 | |
| 35 | $qty = $item->get_quantity(); |
| 36 | $refunded_qty = $order->get_qty_refunded_for_item( $item_id ); |
| 37 | |
| 38 | if ( $refunded_qty ) { |
| 39 | $qty_display = '<del>' . esc_html( $qty ) . '</del> <ins>' . esc_html( $qty - ( $refunded_qty * -1 ) ) . '</ins>'; |
| 40 | } else { |
| 41 | $qty_display = esc_html( $qty ); |
| 42 | } |
| 43 | |
| 44 | echo apply_filters( 'woocommerce_order_item_quantity_html', ' <strong class="product-quantity">' . sprintf( '× %s', $qty_display ) . '</strong>', $item ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
| 45 | |
| 46 | do_action( 'woocommerce_order_item_meta_start', $item_id, $item, $order, false ); |
| 47 | |
| 48 | wc_display_item_meta( $item ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
| 49 | |
| 50 | do_action( 'woocommerce_order_item_meta_end', $item_id, $item, $order, false ); |
| 51 | ?> |
| 52 | </td> |
| 53 | |
| 54 | <td class="woocommerce-table__product-total product-total"> |
| 55 | <?php echo $order->get_formatted_line_subtotal( $item ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> |
| 56 | </td> |
| 57 | |
| 58 | </tr> |
| 59 | |
| 60 | <?php if ( $show_purchase_note && $purchase_note ) : ?> |
| 61 | |
| 62 | <tr class="woocommerce-table__product-purchase-note product-purchase-note"> |
| 63 | |
| 64 | <td colspan="2"><?php echo wpautop( do_shortcode( wp_kses_post( $purchase_note ) ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></td> |
| 65 | |
| 66 | </tr> |
| 67 | |
| 68 | <?php endif; ?> |
| 69 |