Aucune description

order-details-item.php 2.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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 5.2.0
  16. */
  17. if ( ! defined( 'ABSPATH' ) ) {
  18. exit;
  19. }
  20. if ( ! apply_filters( 'woocommerce_order_item_visible', true, $item ) ) {
  21. return;
  22. }
  23. ?>
  24. <tr class="<?php echo esc_attr( apply_filters( 'woocommerce_order_item_class', 'woocommerce-table__line-item order_item', $item, $order ) ); ?>">
  25. <td class="woocommerce-table__product-name product-name">
  26. <?php
  27. $is_visible = $product && $product->is_visible();
  28. $product_permalink = apply_filters( 'woocommerce_order_item_permalink', $is_visible ? $product->get_permalink( $item ) : '', $item, $order );
  29. echo wp_kses_post( 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 ) );
  30. $qty = $item->get_quantity();
  31. $refunded_qty = $order->get_qty_refunded_for_item( $item_id );
  32. if ( $refunded_qty ) {
  33. $qty_display = '<del>' . esc_html( $qty ) . '</del> <ins>' . esc_html( $qty - ( $refunded_qty * -1 ) ) . '</ins>';
  34. } else {
  35. $qty_display = esc_html( $qty );
  36. }
  37. echo apply_filters( 'woocommerce_order_item_quantity_html', ' <strong class="product-quantity">' . sprintf( '&times;&nbsp;%s', $qty_display ) . '</strong>', $item ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
  38. do_action( 'woocommerce_order_item_meta_start', $item_id, $item, $order, false );
  39. wc_display_item_meta( $item ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
  40. do_action( 'woocommerce_order_item_meta_end', $item_id, $item, $order, false );
  41. ?>
  42. </td>
  43. <td class="woocommerce-table__product-total product-total">
  44. <?php echo $order->get_formatted_line_subtotal( $item ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
  45. </td>
  46. </tr>
  47. <?php if ( $show_purchase_note && $purchase_note ) : ?>
  48. <tr class="woocommerce-table__product-purchase-note product-purchase-note">
  49. <td colspan="2"><?php echo wpautop( do_shortcode( wp_kses_post( $purchase_note ) ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></td>
  50. </tr>
  51. <?php endif; ?>