email-downloads.php 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. /**
  3. * Email Downloads.
  4. *
  5. * This template can be overridden by copying it to yourtheme/woocommerce/emails/plain/email-downloads.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.0
  16. */
  17. defined( 'ABSPATH' ) || exit;
  18. echo esc_html( wc_strtoupper( __( 'Downloads', 'woocommerce' ) ) ) . "\n\n";
  19. foreach ( $downloads as $download ) {
  20. foreach ( $columns as $column_id => $column_name ) {
  21. echo wp_kses_post( $column_name ) . ': ';
  22. if ( has_action( 'woocommerce_email_downloads_column_' . $column_id ) ) {
  23. do_action( 'woocommerce_email_downloads_column_' . $column_id, $download, $plain_text );
  24. } else {
  25. switch ( $column_id ) {
  26. case 'download-product':
  27. echo esc_html( $download['product_name'] );
  28. break;
  29. case 'download-file':
  30. echo esc_html( $download['download_name'] ) . ' - ' . esc_url( $download['download_url'] );
  31. break;
  32. case 'download-expires':
  33. if ( ! empty( $download['access_expires'] ) ) {
  34. echo esc_html( date_i18n( get_option( 'date_format' ), strtotime( $download['access_expires'] ) ) );
  35. } else {
  36. esc_html_e( 'Never', 'woocommerce' );
  37. }
  38. break;
  39. }
  40. }
  41. echo "\n";
  42. }
  43. echo "\n";
  44. }
  45. echo '=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=';
  46. echo "\n\n";