view-order.php 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <?php
  2. /**
  3. * View Order
  4. *
  5. * Shows the details of a particular order on the account page.
  6. *
  7. * This template can be overridden by copying it to yourtheme/woocommerce/myaccount/view-order.php.
  8. *
  9. * HOWEVER, on occasion WooCommerce will need to update template files and you
  10. * (the theme developer) will need to copy the new files to your theme to
  11. * maintain compatibility. We try to do this as little as possible, but it does
  12. * happen. When this occurs the version of the template file will be bumped and
  13. * the readme will list any important changes.
  14. *
  15. * @see https://docs.woocommerce.com/document/template-structure/
  16. * @author WooThemes
  17. * @package WooCommerce/Templates
  18. * @version 3.0.0
  19. */
  20. if ( ! defined( 'ABSPATH' ) ) {
  21. exit;
  22. }
  23. ?>
  24. <p><?php
  25. /* translators: 1: order number 2: order date 3: order status */
  26. printf(
  27. __( 'Order #%1$s was placed on %2$s and is currently %3$s.', 'woocommerce' ),
  28. '<mark class="order-number">' . $order->get_order_number() . '</mark>',
  29. '<mark class="order-date">' . wc_format_datetime( $order->get_date_created() ) . '</mark>',
  30. '<mark class="order-status">' . wc_get_order_status_name( $order->get_status() ) . '</mark>'
  31. );
  32. ?></p>
  33. <?php if ( $notes = $order->get_customer_order_notes() ) : ?>
  34. <h2><?php _e( 'Order updates', 'woocommerce' ); ?></h2>
  35. <ol class="woocommerce-OrderUpdates commentlist notes">
  36. <?php foreach ( $notes as $note ) : ?>
  37. <li class="woocommerce-OrderUpdate comment note">
  38. <div class="woocommerce-OrderUpdate-inner comment_container">
  39. <div class="woocommerce-OrderUpdate-text comment-text">
  40. <p class="woocommerce-OrderUpdate-meta meta"><?php echo date_i18n( __( 'l jS \o\f F Y, h:ia', 'woocommerce' ), strtotime( $note->comment_date ) ); ?></p>
  41. <div class="woocommerce-OrderUpdate-description description">
  42. <?php echo wpautop( wptexturize( $note->comment_content ) ); ?>
  43. </div>
  44. <div class="clear"></div>
  45. </div>
  46. <div class="clear"></div>
  47. </div>
  48. </li>
  49. <?php endforeach; ?>
  50. </ol>
  51. <?php endif; ?>
  52. <?php do_action( 'woocommerce_view_order', $order_id ); ?>