block
2 months ago
plain
1 month ago
admin-cancelled-order.php
1 year ago
admin-failed-order.php
7 months ago
admin-new-order.php
7 months ago
admin-payment-gateway-enabled.php
3 months ago
customer-cancelled-order.php
7 months ago
customer-completed-order.php
7 months ago
customer-failed-order.php
7 months ago
customer-fulfillment-created.php
7 months ago
customer-fulfillment-deleted.php
7 months ago
customer-fulfillment-updated.php
2 months ago
customer-invoice.php
7 months ago
customer-new-account.php
1 month ago
customer-note.php
7 months ago
customer-on-hold-order.php
7 months ago
customer-pos-completed-order.php
7 months ago
customer-pos-refunded-order.php
7 months ago
customer-processing-order.php
7 months ago
customer-refunded-order.php
7 months ago
customer-reset-password.php
1 month ago
customer-review-request.php
2 months ago
customer-stock-notification-verified.php
1 month ago
customer-stock-notification-verify.php
10 months ago
customer-stock-notification.php
10 months ago
email-addresses.php
4 months ago
email-customer-details.php
1 year ago
email-downloads.php
7 months ago
email-footer.php
7 months ago
email-fulfillment-details.php
3 months ago
email-fulfillment-items.php
2 months ago
email-header.php
3 months ago
email-mobile-messaging.php
2 years ago
email-order-details.php
2 months ago
email-order-items.php
2 months ago
email-styles.php
2 months ago
email-downloads.php
90 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Email Downloads. |
| 4 | * |
| 5 | * This template can be overridden by copying it to yourtheme/woocommerce/emails/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://woocommerce.com/document/template-structure/ |
| 14 | * @package WooCommerce\Templates |
| 15 | * @version 10.4.0 |
| 16 | */ |
| 17 | |
| 18 | use Automattic\WooCommerce\Utilities\FeaturesUtil; |
| 19 | |
| 20 | defined( 'ABSPATH' ) || exit; |
| 21 | |
| 22 | $email_improvements_enabled = FeaturesUtil::feature_is_enabled( 'email_improvements' ); |
| 23 | |
| 24 | ?><h2 class="woocommerce-order-downloads__title<?php echo $email_improvements_enabled ? ' email-order-detail-heading' : ''; ?>"><?php esc_html_e( 'Downloads', 'woocommerce' ); ?></h2> |
| 25 | |
| 26 | <table |
| 27 | class="td font-family<?php echo $email_improvements_enabled ? ' email-order-details' : ''; ?>" |
| 28 | cellspacing="0" |
| 29 | cellpadding="<?php echo $email_improvements_enabled ? '0' : '6'; ?>" |
| 30 | style="width: 100%; margin-bottom: 40px;" |
| 31 | border="<?php echo $email_improvements_enabled ? '0' : '1'; ?>" |
| 32 | > |
| 33 | <thead> |
| 34 | <tr> |
| 35 | <?php foreach ( $columns as $column_id => $column_name ) : ?> |
| 36 | <th class="td <?php echo $email_improvements_enabled && array_key_last( $columns ) === $column_id ? 'text-align-right' : 'text-align-left'; ?>" scope="col"> |
| 37 | <?php echo esc_html( $column_name ); ?> |
| 38 | </th> |
| 39 | <?php endforeach; ?> |
| 40 | </tr> |
| 41 | </thead> |
| 42 | |
| 43 | <?php foreach ( $downloads as $download ) : ?> |
| 44 | <tr> |
| 45 | <?php foreach ( $columns as $column_id => $column_name ) : ?> |
| 46 | <?php |
| 47 | $column_alignment_class = $email_improvements_enabled && array_key_last( $columns ) === $column_id ? 'text-align-right' : 'text-align-left'; |
| 48 | if ( 'download-product' === $column_id ) : |
| 49 | ?> |
| 50 | <th class="td <?php echo esc_attr( $column_alignment_class ); ?>" scope="row"> |
| 51 | <?php else : ?> |
| 52 | <td class="td <?php echo esc_attr( $column_alignment_class ); ?>"> |
| 53 | <?php endif; ?> |
| 54 | <?php |
| 55 | if ( has_action( 'woocommerce_email_downloads_column_' . $column_id ) ) { |
| 56 | do_action( 'woocommerce_email_downloads_column_' . $column_id, $download, $plain_text ); |
| 57 | } else { |
| 58 | switch ( $column_id ) { |
| 59 | case 'download-product': |
| 60 | ?> |
| 61 | <a href="<?php echo esc_url( get_permalink( $download['product_id'] ) ); ?>"><?php echo wp_kses_post( $download['product_name'] ); ?></a> |
| 62 | <?php |
| 63 | break; |
| 64 | case 'download-file': |
| 65 | ?> |
| 66 | <a href="<?php echo esc_url( $download['download_url'] ); ?>" class="woocommerce-MyAccount-downloads-file button alt"><?php echo esc_html( $download['download_name'] ); ?></a> |
| 67 | <?php |
| 68 | break; |
| 69 | case 'download-expires': |
| 70 | if ( ! empty( $download['access_expires'] ) ) { |
| 71 | ?> |
| 72 | <time datetime="<?php echo esc_attr( date( 'Y-m-d', strtotime( $download['access_expires'] ) ) ); ?>" title="<?php echo esc_attr( strtotime( $download['access_expires'] ) ); ?>"><?php echo esc_html( date_i18n( get_option( 'date_format' ), strtotime( $download['access_expires'] ) ) ); ?></time> |
| 73 | <?php |
| 74 | } else { |
| 75 | esc_html_e( 'Never', 'woocommerce' ); |
| 76 | } |
| 77 | break; |
| 78 | } |
| 79 | } |
| 80 | ?> |
| 81 | <?php if ( 'download-product' === $column_id ) : ?> |
| 82 | </th> |
| 83 | <?php else : ?> |
| 84 | </td> |
| 85 | <?php endif; ?> |
| 86 | <?php endforeach; ?> |
| 87 | </tr> |
| 88 | <?php endforeach; ?> |
| 89 | </table> |
| 90 |