block
4 months ago
plain
9 months ago
admin-cancelled-order.php
1 year ago
admin-failed-order.php
7 months ago
admin-new-order.php
7 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
7 months ago
customer-invoice.php
7 months ago
customer-new-account.php
7 months 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
7 months ago
customer-stock-notification-verified.php
9 months ago
customer-stock-notification-verify.php
9 months ago
customer-stock-notification.php
9 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
10 months ago
email-fulfillment-items.php
10 months ago
email-header.php
7 months ago
email-mobile-messaging.php
2 years ago
email-order-details.php
4 months ago
email-order-items.php
7 months ago
email-styles.php
5 months ago
email-fulfillment-details.php
112 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Order fulfillment details table shown in emails. |
| 4 | * |
| 5 | * This template can be overridden by copying it to yourtheme/woocommerce/emails/email-fulfillment-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://woocommerce.com/document/template-structure/ |
| 14 | * @package WooCommerce\Templates\Emails |
| 15 | * @version 10.1.0 |
| 16 | */ |
| 17 | |
| 18 | defined( 'ABSPATH' ) || exit; |
| 19 | |
| 20 | $text_align = is_rtl() ? 'right' : 'left'; |
| 21 | |
| 22 | $heading_class = 'email-order-detail-heading'; |
| 23 | $order_table_class = 'email-order-details'; |
| 24 | $order_total_text_align = 'right'; |
| 25 | |
| 26 | if ( null === $fulfillment->get_date_deleted() ) { |
| 27 | $tracking_number = $fulfillment->get_meta( '_tracking_number', true ); |
| 28 | $tracking_url = $fulfillment->get_meta( '_tracking_url' ); |
| 29 | $shipment_provider = $fulfillment->get_meta( '_shipment_provider' ); |
| 30 | if ( ! $tracking_number && ! $tracking_url && ! $shipment_provider ) { |
| 31 | echo '<p>' . esc_html__( 'No tracking information available for this fulfillment at the moment.', 'woocommerce' ) . '</p>'; |
| 32 | } else { |
| 33 | echo '<p><strong>' . esc_html__( 'Tracking Number', 'woocommerce' ) . ':</strong> ' . esc_attr( $tracking_number ) . '</p>'; |
| 34 | echo '<p><strong>' . esc_html__( 'Shipment Provider', 'woocommerce' ) . ':</strong> ' . esc_html( $shipment_provider ) . '</p>'; |
| 35 | echo '<p><a href="' . esc_url( $tracking_url ) . '" target="_blank">' . esc_attr__( 'Track your shipment', 'woocommerce' ) . '</a></p>'; |
| 36 | } |
| 37 | echo '<br />'; |
| 38 | echo '<p>'; |
| 39 | echo wp_kses_post( |
| 40 | sprintf( |
| 41 | /* translators: %s: Link to My Account > Orders page. */ |
| 42 | __( 'You can access to more details of your order by visiting <a href="%s" target="_blank">My Account > Orders</a> and select the order you wish to see the latest status of the delivery.', 'woocommerce' ), |
| 43 | site_url( 'my-account/orders/' ) |
| 44 | ) |
| 45 | ); |
| 46 | echo '</p>'; |
| 47 | } |
| 48 | /** |
| 49 | * Action hook to add custom content before fulfillment details in email. |
| 50 | * |
| 51 | * @param WC_Order $order Order object. |
| 52 | * @param Fulfillment $fulfillment Fulfillment object. |
| 53 | * @param bool $sent_to_admin Whether it's sent to admin or customer. |
| 54 | * @param bool $plain_text Whether it's a plain text email. |
| 55 | * @param WC_Email $email Email object. |
| 56 | * @since 2.5.0 |
| 57 | */ |
| 58 | do_action( 'woocommerce_email_before_fulfillment_table', $order, $fulfillment, $sent_to_admin, $plain_text, $email ); |
| 59 | ?> |
| 60 | |
| 61 | <h2 class="<?php echo esc_attr( $heading_class ); ?>"> |
| 62 | <?php |
| 63 | echo wp_kses_post( __( 'Fulfillment summary', 'woocommerce' ) ); |
| 64 | if ( $sent_to_admin ) { |
| 65 | $before = '<a class="link" href="' . esc_url( $order->get_edit_order_url() ) . '">'; |
| 66 | $after = '</a>'; |
| 67 | } else { |
| 68 | $before = ''; |
| 69 | $after = ''; |
| 70 | } |
| 71 | echo '<br><span>'; |
| 72 | /* translators: %s: Order ID. */ |
| 73 | $order_number_string = __( 'Order #%s', 'woocommerce' ); |
| 74 | echo wp_kses_post( $before . sprintf( $order_number_string . $after . ' (<time datetime="%s">%s</time>)', $order->get_order_number(), $order->get_date_created()->format( 'c' ), wc_format_datetime( $order->get_date_created() ) ) ); |
| 75 | echo '</span>'; |
| 76 | ?> |
| 77 | </h2> |
| 78 | |
| 79 | <div style="margin-bottom: 24px;"> |
| 80 | <table class="td font-family <?php echo esc_attr( $order_table_class ); ?>" cellspacing="0" cellpadding="6" style="width: 100%;" border="1"> |
| 81 | <tbody> |
| 82 | <?php |
| 83 | echo wc_get_email_fulfillment_items( // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
| 84 | $order, |
| 85 | $fulfillment, |
| 86 | array( |
| 87 | 'show_sku' => $sent_to_admin, |
| 88 | 'show_image' => true, |
| 89 | 'image_size' => array( 48, 48 ), |
| 90 | 'plain_text' => $plain_text, |
| 91 | 'sent_to_admin' => $sent_to_admin, |
| 92 | ) |
| 93 | ); |
| 94 | ?> |
| 95 | </tbody> |
| 96 | </table> |
| 97 | </div> |
| 98 | |
| 99 | <?php |
| 100 | |
| 101 | /** |
| 102 | * Action hook to add custom content after fulfillment details in email. |
| 103 | * |
| 104 | * @param WC_Order $order Order object. |
| 105 | * @param bool $sent_to_admin Whether it's sent to admin or customer. |
| 106 | * @param bool $plain_text Whether it's a plain text email. |
| 107 | * @param WC_Email $email Email object. |
| 108 | * @since 2.5.0 |
| 109 | */ |
| 110 | do_action( 'woocommerce_email_after_fulfillment_table', $order, $fulfillment, $sent_to_admin, $plain_text, $email ); |
| 111 | ?> |
| 112 |