html-order-refund.php 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. <?php
  2. /**
  3. * Show order refund
  4. *
  5. * @var object $refund The refund object.
  6. * @package WooCommerce\Admin
  7. */
  8. if ( ! defined( 'ABSPATH' ) ) {
  9. exit; // Exit if accessed directly.
  10. }
  11. $who_refunded = new WP_User( $refund->get_refunded_by() );
  12. ?>
  13. <tr class="refund <?php echo ( ! empty( $class ) ) ? esc_attr( $class ) : ''; ?>" data-order_refund_id="<?php echo esc_attr( $refund->get_id() ); ?>">
  14. <td class="thumb"><div></div></td>
  15. <td class="name">
  16. <?php
  17. if ( $who_refunded->exists() ) {
  18. printf(
  19. /* translators: 1: refund id 2: refund date 3: username */
  20. esc_html__( 'Refund #%1$s - %2$s by %3$s', 'woocommerce' ),
  21. esc_html( $refund->get_id() ),
  22. esc_html( wc_format_datetime( $refund->get_date_created(), get_option( 'date_format' ) . ', ' . get_option( 'time_format' ) ) ),
  23. sprintf(
  24. '<abbr class="refund_by" title="%1$s">%2$s</abbr>',
  25. /* translators: 1: ID who refunded */
  26. sprintf( esc_attr__( 'ID: %d', 'woocommerce' ), absint( $who_refunded->ID ) ),
  27. esc_html( $who_refunded->display_name )
  28. )
  29. );
  30. } else {
  31. printf(
  32. /* translators: 1: refund id 2: refund date */
  33. esc_html__( 'Refund #%1$s - %2$s', 'woocommerce' ),
  34. esc_html( $refund->get_id() ),
  35. esc_html( wc_format_datetime( $refund->get_date_created(), get_option( 'date_format' ) . ', ' . get_option( 'time_format' ) ) )
  36. );
  37. }
  38. ?>
  39. <?php if ( $refund->get_reason() ) : ?>
  40. <p class="description"><?php echo esc_html( $refund->get_reason() ); ?></p>
  41. <?php endif; ?>
  42. <input type="hidden" class="order_refund_id" name="order_refund_id[]" value="<?php echo esc_attr( $refund->get_id() ); ?>" />
  43. </td>
  44. <?php do_action( 'woocommerce_admin_order_item_values', null, $refund, $refund->get_id() ); ?>
  45. <td class="item_cost" width="1%">&nbsp;</td>
  46. <td class="quantity" width="1%">&nbsp;</td>
  47. <td class="line_cost" width="1%">
  48. <div class="view">
  49. <?php
  50. echo wp_kses_post(
  51. wc_price( '-' . $refund->get_amount(), array( 'currency' => $refund->get_currency() ) )
  52. );
  53. ?>
  54. </div>
  55. </td>
  56. <?php
  57. if ( wc_tax_enabled() ) :
  58. $total_taxes = count( $order_taxes );
  59. ?>
  60. <?php for ( $i = 0; $i < $total_taxes; $i++ ) : ?>
  61. <td class="line_tax" width="1%"></td>
  62. <?php endfor; ?>
  63. <?php endif; ?>
  64. <td class="wc-order-edit-line-item">
  65. <div class="wc-order-edit-line-item-actions">
  66. <a class="delete_refund" href="#"></a>
  67. </div>
  68. </td>
  69. </tr>