order-details-item.php 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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. * @author WooThemes
  15. * @package WooCommerce/Templates
  16. * @version 3.0.0
  17. */
  18. if ( ! defined( 'ABSPATH' ) ) {
  19. exit;
  20. }
  21. if ( ! apply_filters( 'woocommerce_order_item_visible', true, $item ) ) {
  22. return;
  23. }
  24. ?>
  25. <tr class="<?php echo esc_attr( apply_filters( 'woocommerce_order_item_class', 'woocommerce-table__line-item order_item', $item, $order ) ); ?>">
  26. <td class="woocommerce-table__product-name product-name">
  27. <?php
  28. $is_visible = $product && $product->is_visible();
  29. $product_permalink = apply_filters( 'woocommerce_order_item_permalink', $is_visible ? $product->get_permalink( $item ) : '', $item, $order );
  30. 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 );
  31. echo apply_filters( 'woocommerce_order_item_quantity_html', ' <strong class="product-quantity">' . sprintf( '&times; %s', $item->get_quantity() ) . '</strong>', $item );
  32. do_action( 'woocommerce_order_item_meta_start', $item_id, $item, $order, false );
  33. wc_display_item_meta( $item );
  34. do_action( 'woocommerce_order_item_meta_end', $item_id, $item, $order, false );
  35. ?>
  36. </td>
  37. <td class="woocommerce-table__product-total product-total">
  38. <?php echo $order->get_formatted_line_subtotal( $item ); ?>
  39. </td>
  40. </tr>
  41. <?php if ( $show_purchase_note && $purchase_note ) : ?>
  42. <tr class="woocommerce-table__product-purchase-note product-purchase-note">
  43. <td colspan="2"><?php echo wpautop( do_shortcode( wp_kses_post( $purchase_note ) ) ); ?></td>
  44. </tr>
  45. <?php endif; ?>