Nenhuma Descrição

email-order-details.php 1.9KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php
  2. /**
  3. * Order details table shown in emails.
  4. *
  5. * This template can be overridden by copying it to yourtheme/woocommerce/emails/plain/email-order-details.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. defined( 'ABSPATH' ) || exit;
  18. do_action( 'woocommerce_email_before_order_table', $order, $sent_to_admin, $plain_text, $email );
  19. /* translators: %1$s: Order ID. %2$s: Order date */
  20. echo wp_kses_post( wc_strtoupper( sprintf( esc_html__( '[Order #%1$s] (%2$s)', 'woocommerce' ), $order->get_order_number(), wc_format_datetime( $order->get_date_created() ) ) ) ) . "\n";
  21. echo "\n" . wc_get_email_order_items( // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
  22. $order,
  23. array(
  24. 'show_sku' => $sent_to_admin,
  25. 'show_image' => false,
  26. 'image_size' => array( 32, 32 ),
  27. 'plain_text' => true,
  28. 'sent_to_admin' => $sent_to_admin,
  29. )
  30. );
  31. echo "==========\n\n";
  32. $item_totals = $order->get_order_item_totals();
  33. if ( $item_totals ) {
  34. foreach ( $item_totals as $total ) {
  35. echo wp_kses_post( $total['label'] . "\t " . $total['value'] ) . "\n";
  36. }
  37. }
  38. if ( $order->get_customer_note() ) {
  39. echo esc_html__( 'Note:', 'woocommerce' ) . "\t " . wp_kses_post( wptexturize( $order->get_customer_note() ) ) . "\n";
  40. }
  41. if ( $sent_to_admin ) {
  42. /* translators: %s: Order link. */
  43. echo "\n" . sprintf( esc_html__( 'View order: %s', 'woocommerce' ), esc_url( $order->get_edit_order_url() ) ) . "\n";
  44. }
  45. do_action( 'woocommerce_email_after_order_table', $order, $sent_to_admin, $plain_text, $email );