order-details-customer.php 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <?php
  2. /**
  3. * Order Customer Details
  4. *
  5. * This template can be overridden by copying it to yourtheme/woocommerce/order/order-details-customer.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.4.4
  16. */
  17. if ( ! defined( 'ABSPATH' ) ) {
  18. exit;
  19. }
  20. $show_shipping = ! wc_ship_to_billing_address_only() && $order->needs_shipping_address();
  21. ?>
  22. <section class="woocommerce-customer-details">
  23. <?php if ( $show_shipping ) : ?>
  24. <section class="woocommerce-columns woocommerce-columns--2 woocommerce-columns--addresses col2-set addresses">
  25. <div class="woocommerce-column woocommerce-column--1 woocommerce-column--billing-address col-1">
  26. <?php endif; ?>
  27. <h2 class="woocommerce-column__title"><?php esc_html_e( 'Billing address', 'woocommerce' ); ?></h2>
  28. <address>
  29. <?php echo wp_kses_post( $order->get_formatted_billing_address( __( 'N/A', 'woocommerce' ) ) ); ?>
  30. <?php if ( $order->get_billing_phone() ) : ?>
  31. <p class="woocommerce-customer-details--phone"><?php echo esc_html( $order->get_billing_phone() ); ?></p>
  32. <?php endif; ?>
  33. <?php if ( $order->get_billing_email() ) : ?>
  34. <p class="woocommerce-customer-details--email"><?php echo esc_html( $order->get_billing_email() ); ?></p>
  35. <?php endif; ?>
  36. </address>
  37. <?php if ( $show_shipping ) : ?>
  38. </div><!-- /.col-1 -->
  39. <div class="woocommerce-column woocommerce-column--2 woocommerce-column--shipping-address col-2">
  40. <h2 class="woocommerce-column__title"><?php esc_html_e( 'Shipping address', 'woocommerce' ); ?></h2>
  41. <address>
  42. <?php echo wp_kses_post( $order->get_formatted_shipping_address( __( 'N/A', 'woocommerce' ) ) ); ?>
  43. </address>
  44. </div><!-- /.col-2 -->
  45. </section><!-- /.col2-set -->
  46. <?php endif; ?>
  47. <?php do_action( 'woocommerce_order_details_after_customer_details', $order ); ?>
  48. </section>