email-addresses.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. /**
  3. * Email Addresses (plain)
  4. *
  5. * This template can be overridden by copying it to yourtheme/woocommerce/emails/plain/email-addresses.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/Emails/Plain
  15. * @version 3.4.0
  16. */
  17. if ( ! defined( 'ABSPATH' ) ) {
  18. exit;
  19. }
  20. echo "\n" . esc_html( wc_strtoupper( __( 'Billing address', 'woocommerce' ) ) ) . "\n\n";
  21. echo preg_replace( '#<br\s*/?>#i', "\n", $order->get_formatted_billing_address() ) . "\n"; // WPCS: XSS ok.
  22. if ( $order->get_billing_phone() ) {
  23. echo $order->get_billing_phone() . "\n"; // WPCS: XSS ok.
  24. }
  25. if ( $order->get_billing_email() ) {
  26. echo $order->get_billing_email() . "\n"; // WPCS: XSS ok.
  27. }
  28. if ( ! wc_ship_to_billing_address_only() && $order->needs_shipping_address() ) {
  29. $shipping = $order->get_formatted_shipping_address();
  30. if ( $shipping ) {
  31. echo "\n" . esc_html( wc_strtoupper( __( 'Shipping address', 'woocommerce' ) ) ) . "\n\n";
  32. echo preg_replace( '#<br\s*/?>#i', "\n", $shipping ) . "\n"; // WPCS: XSS ok.
  33. }
  34. }