Advertisement
Guest User

Untitled

a guest
Feb 18th, 2020
249
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.05 KB | None | 0 0
  1. <?php
  2. /**
  3.  * Customer invoice email
  4.  *
  5.  * This template can be overridden by copying it to yourtheme/woocommerce/emails/customer-invoice.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
  15.  * @version 3.7.0
  16.  */
  17.  
  18. if ( ! defined( 'ABSPATH' ) ) {
  19.     exit;
  20. }
  21.  
  22. /**
  23.  * Executes the e-mail header.
  24.  *
  25.  * @hooked WC_Emails::email_header() Output the email header
  26.  */
  27. do_action( 'woocommerce_email_header', $email_heading, $email ); ?>
  28.  
  29. <?php /* translators: %s: Customer first name */ ?>
  30. <p><?php printf( esc_html__( 'Hi %s,', 'woocommerce' ), esc_html( $order->get_billing_first_name() ) ); ?></p>
  31.  
  32. <?php if ( $order->has_status( 'pending' ) ) { ?>
  33.     <p>
  34.     <?php
  35.     printf(
  36.         wp_kses(
  37.             /* translators: %1$s Site title, %2$s Order pay link */
  38.             __( 'An order has been created for you on %1$s. Your invoice is below, with a link to make payment when you’re ready: %2$s', 'woocommerce' ),
  39.             array(
  40.                 'a' => array(
  41.                     'href' => array(),
  42.                 ),
  43.             )
  44.         ),
  45.         esc_html( get_bloginfo( 'name', 'display' ) ),
  46.         '<a href="' . esc_url( $order->get_checkout_payment_url() ) . '">' . esc_html__( 'Pay for this order', 'woocommerce' ) . '</a>'
  47.     );
  48.     ?>
  49.     </p>
  50.  
  51. <?php } else { ?>
  52.     <p>
  53.     <?php
  54.     /* translators: %s Order date */
  55.     printf( esc_html__( 'Here are the details of your order placed on %s:', 'woocommerce' ), esc_html( wc_format_datetime( $order->get_date_created() ) ) );
  56.     ?>
  57.     </p>
  58.     <?php
  59. }
  60.  
  61. /**
  62.  * Hook for the woocommerce_email_order_details.
  63.  *
  64.  * @hooked WC_Emails::order_details() Shows the order details table.
  65.  * @hooked WC_Structured_Data::generate_order_data() Generates structured data.
  66.  * @hooked WC_Structured_Data::output_structured_data() Outputs structured data.
  67.  * @since 2.5.0
  68.  */
  69. do_action( 'woocommerce_email_order_details', $order, $sent_to_admin, $plain_text, $email );
  70.  
  71. /**
  72.  * Hook for the woocommerce_email_order_meta.
  73.  *
  74.  * @hooked WC_Emails::order_meta() Shows order meta data.
  75.  */
  76. do_action( 'woocommerce_email_order_meta', $order, $sent_to_admin, $plain_text, $email );
  77.  
  78. /**
  79.  * Hook for woocommerce_email_customer_details.
  80.  *
  81.  * @hooked WC_Emails::customer_details() Shows customer details
  82.  * @hooked WC_Emails::email_address() Shows email address
  83.  */
  84. do_action( 'woocommerce_email_customer_details', $order, $sent_to_admin, $plain_text, $email );
  85.  
  86. /**
  87.  * Show user-defined additional content - this is set in each email's settings.
  88.  */
  89. if ( $additional_content ) {
  90.     echo wp_kses_post( wpautop( wptexturize( $additional_content ) ) );
  91. }
  92.  
  93. /**
  94.  * Executes the email footer.
  95.  *
  96.  * @hooked WC_Emails::email_footer() Output the email footer
  97.  */
  98. do_action( 'woocommerce_email_footer', $email );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement