first commit

This commit is contained in:
User A0264400
2026-04-01 23:20:16 +03:00
commit a766acdc90
23071 changed files with 4933189 additions and 0 deletions

View File

@@ -0,0 +1,67 @@
<?php
/**
* Admin cancelled order email (plain text)
*
* This template can be overridden by copying it to yourtheme/woocommerce/emails/plain/admin-cancelled-order.php.
*
* HOWEVER, on occasion WooCommerce will need to update template files and you
* (the theme developer) will need to copy the new files to your theme to
* maintain compatibility. We try to do this as little as possible, but it does
* happen. When this occurs the version of the template file will be bumped and
* the readme will list any important changes.
*
* @see https://woocommerce.com/document/template-structure/
* @package WooCommerce\Templates\Emails\Plain
* @version 9.8.0
*/
use Automattic\WooCommerce\Utilities\FeaturesUtil;
defined( 'ABSPATH' ) || exit;
$email_improvements_enabled = FeaturesUtil::feature_is_enabled( 'email_improvements' );
echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n";
echo esc_html( wp_strip_all_tags( $email_heading ) );
echo "\n=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n";
/* translators: %1$s: Order number. %2$s: Customer full name */
$text = __( 'Notification to let you know &mdash; order #%1$s belonging to %2$s has been cancelled:', 'woocommerce' );
if ( $email_improvements_enabled ) {
/* translators: %1$s: Order number. %2$s: Customer full name */
$text = __( 'Were getting in touch to let you know that order #%1$s from %2$s has been cancelled.', 'woocommerce' );
}
echo sprintf( esc_html( $text ), esc_html( $order->get_order_number() ), esc_html( $order->get_formatted_billing_full_name() ) ) . "\n\n";
/*
* @hooked WC_Emails::order_details() Shows the order details table.
* @hooked WC_Structured_Data::generate_order_data() Generates structured data.
* @hooked WC_Structured_Data::output_structured_data() Outputs structured data.
* @since 2.5.0
*/
do_action( 'woocommerce_email_order_details', $order, $sent_to_admin, $plain_text, $email );
echo "\n----------------------------------------\n\n";
/*
* @hooked WC_Emails::order_meta() Shows order meta data.
*/
do_action( 'woocommerce_email_order_meta', $order, $sent_to_admin, $plain_text, $email );
/*
* @hooked WC_Emails::customer_details() Shows customer details
* @hooked WC_Emails::email_address() Shows email address
*/
do_action( 'woocommerce_email_customer_details', $order, $sent_to_admin, $plain_text, $email );
echo "\n\n----------------------------------------\n\n";
/**
* Show user-defined additional content - this is set in each email's settings.
*/
if ( $additional_content ) {
echo esc_html( wp_strip_all_tags( wptexturize( $additional_content ) ) );
echo "\n\n----------------------------------------\n\n";
}
echo wp_kses_post( apply_filters( 'woocommerce_email_footer_text', get_option( 'woocommerce_email_footer_text' ) ) );

View File

@@ -0,0 +1,67 @@
<?php
/**
* Admin failed order email (plain text)
*
* This template can be overridden by copying it to yourtheme/woocommerce/emails/plain/admin-failed-order.php
*
* HOWEVER, on occasion WooCommerce will need to update template files and you
* (the theme developer) will need to copy the new files to your theme to
* maintain compatibility. We try to do this as little as possible, but it does
* happen. When this occurs the version of the template file will be bumped and
* the readme will list any important changes.
*
* @see https://woocommerce.com/document/template-structure/
* @package WooCommerce\Templates\Emails\Plain
* @version 9.8.0
*/
use Automattic\WooCommerce\Utilities\FeaturesUtil;
defined( 'ABSPATH' ) || exit;
$email_improvements_enabled = FeaturesUtil::feature_is_enabled( 'email_improvements' );
echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n";
echo esc_html( wp_strip_all_tags( $email_heading ) );
echo "\n=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n";
/* translators: %1$s: Order number. %2$s: Customer full name. */
$text = __( 'Payment for order #%1$s from %2$s has failed. The order was as follows:', 'woocommerce' );
if ( $email_improvements_enabled ) {
/* translators: %1$s: Order number. %2$s: Customer full name. */
$text = __( 'Unfortunately, the payment for order #%1$s from %2$s has failed. The order was as follows:', 'woocommerce' );
}
echo sprintf( esc_html( $text ), esc_html( $order->get_order_number() ), esc_html( $order->get_formatted_billing_full_name() ) ) . "\n\n";
/*
* @hooked WC_Emails::order_details() Shows the order details table.
* @hooked WC_Structured_Data::generate_order_data() Generates structured data.
* @hooked WC_Structured_Data::output_structured_data() Outputs structured data.
* @since 2.5.0
*/
do_action( 'woocommerce_email_order_details', $order, $sent_to_admin, $plain_text, $email );
echo "\n----------------------------------------\n\n";
/*
* @hooked WC_Emails::order_meta() Shows order meta data.
*/
do_action( 'woocommerce_email_order_meta', $order, $sent_to_admin, $plain_text, $email );
/*
* @hooked WC_Emails::customer_details() Shows customer details
* @hooked WC_Emails::email_address() Shows email address
*/
do_action( 'woocommerce_email_customer_details', $order, $sent_to_admin, $plain_text, $email );
echo "\n\n----------------------------------------\n\n";
/**
* Show user-defined additional content - this is set in each email's settings.
*/
if ( $additional_content ) {
echo esc_html( wp_strip_all_tags( wptexturize( $additional_content ) ) );
echo "\n\n----------------------------------------\n\n";
}
echo wp_kses_post( apply_filters( 'woocommerce_email_footer_text', get_option( 'woocommerce_email_footer_text' ) ) );

View File

@@ -0,0 +1,67 @@
<?php
/**
* Admin new order email (plain text)
*
* This template can be overridden by copying it to yourtheme/woocommerce/emails/plain/admin-new-order.php.
*
* HOWEVER, on occasion WooCommerce will need to update template files and you
* (the theme developer) will need to copy the new files to your theme to
* maintain compatibility. We try to do this as little as possible, but it does
* happen. When this occurs the version of the template file will be bumped and
* the readme will list any important changes.
*
* @see https://woocommerce.com/document/template-structure/
* @package WooCommerce\Templates\Emails\Plain
* @version 10.0.0
*/
use Automattic\WooCommerce\Utilities\FeaturesUtil;
defined( 'ABSPATH' ) || exit;
$email_improvements_enabled = FeaturesUtil::feature_is_enabled( 'email_improvements' );
echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n";
echo esc_html( wp_strip_all_tags( $email_heading ) );
echo "\n=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n";
/* translators: %s: Customer billing full name */
$text = __( 'Youve received the following order from %s:', 'woocommerce' );
if ( $email_improvements_enabled ) {
/* translators: %s: Customer billing full name */
$text = __( 'Youve received a new order from %s:', 'woocommerce' );
}
echo sprintf( esc_html( $text ), esc_html( $order->get_formatted_billing_full_name() ) ) . "\n\n";
/*
* @hooked WC_Emails::order_details() Shows the order details table.
* @hooked WC_Structured_Data::generate_order_data() Generates structured data.
* @hooked WC_Structured_Data::output_structured_data() Outputs structured data.
* @since 2.5.0
*/
do_action( 'woocommerce_email_order_details', $order, $sent_to_admin, $plain_text, $email );
echo "\n----------------------------------------\n\n";
/*
* @hooked WC_Emails::order_meta() Shows order meta data.
*/
do_action( 'woocommerce_email_order_meta', $order, $sent_to_admin, $plain_text, $email );
/*
* @hooked WC_Emails::customer_details() Shows customer details
* @hooked WC_Emails::email_address() Shows email address
*/
do_action( 'woocommerce_email_customer_details', $order, $sent_to_admin, $plain_text, $email );
echo "\n\n----------------------------------------\n\n";
/**
* Show user-defined additional content - this is set in each email's settings.
*/
if ( $additional_content ) {
echo esc_html( wp_strip_all_tags( wptexturize( $additional_content ) ) );
echo "\n\n----------------------------------------\n\n";
}
echo wp_kses_post( apply_filters( 'woocommerce_email_footer_text', get_option( 'woocommerce_email_footer_text' ) ) );

View File

@@ -0,0 +1,81 @@
<?php
/**
* Customer cancelled order email (plain text)
*
* This template can be overridden by copying it to yourtheme/woocommerce/emails/plain/customer-cancelled-order.php.
*
* HOWEVER, on occasion WooCommerce will need to update template files and you
* (the theme developer) will need to copy the new files to your theme to
* maintain compatibility. We try to do this as little as possible, but it does
* happen. When this occurs the version of the template file will be bumped and
* the readme will list any important changes.
*
* @see https://woocommerce.com/document/template-structure/
* @package WooCommerce\Templates\Emails\Plain
* @version 10.0.0
*/
use Automattic\WooCommerce\Utilities\FeaturesUtil;
defined( 'ABSPATH' ) || exit;
$email_improvements_enabled = FeaturesUtil::feature_is_enabled( 'email_improvements' );
echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n";
echo esc_html( wp_strip_all_tags( $email_heading ) );
echo "\n=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n";
/* translators: %1$s: Order number */
$text = __( 'Were sorry to let you know that your order #%1$s has been cancelled.', 'woocommerce' );
if ( $email_improvements_enabled ) {
/* translators: %1$s: Order number */
$text = __( 'Were getting in touch to let you know that your order #%1$s has been cancelled.', 'woocommerce' );
}
echo sprintf( esc_html( $text ), esc_html( $order->get_order_number() ) ) . "\n\n";
/**
* Hook: woocommerce_email_order_details.
*
* @hooked WC_Emails::order_details() Shows the order details table.
* @hooked WC_Structured_Data::generate_order_data() Generates structured data.
* @hooked WC_Structured_Data::output_structured_data() Outputs structured data.
* @since 2.5.0
*/
do_action( 'woocommerce_email_order_details', $order, $sent_to_admin, $plain_text, $email );
echo "\n----------------------------------------\n\n";
/**
* Hook: woocommerce_email_order_meta.
*
* @hooked WC_Emails::order_meta() Shows order meta data.
* @since 2.5.0
*/
do_action( 'woocommerce_email_order_meta', $order, $sent_to_admin, $plain_text, $email );
/**
* Hook: woocommerce_email_customer_details.
*
* @hooked WC_Emails::customer_details() Shows customer details
* @hooked WC_Emails::email_address() Shows email address
* @since 2.5.0
*/
do_action( 'woocommerce_email_customer_details', $order, $sent_to_admin, $plain_text, $email );
echo "\n\n----------------------------------------\n\n";
/**
* Show user-defined additional content - this is set in each email's settings.
*/
if ( $additional_content ) {
echo esc_html( wp_strip_all_tags( wptexturize( $additional_content ) ) );
echo "\n\n----------------------------------------\n\n";
}
/**
* Hook: woocommerce_email_footer.
*
* @hooked WC_Emails::email_footer() Output the email footer
* @since 2.5.0
*/
do_action( 'woocommerce_email_footer', $email );

View File

@@ -0,0 +1,66 @@
<?php
/**
* Customer completed order email (plain text)
*
* This template can be overridden by copying it to yourtheme/woocommerce/emails/plain/customer-completed-order.php.
*
* HOWEVER, on occasion WooCommerce will need to update template files and you
* (the theme developer) will need to copy the new files to your theme to
* maintain compatibility. We try to do this as little as possible, but it does
* happen. When this occurs the version of the template file will be bumped and
* the readme will list any important changes.
*
* @see https://woocommerce.com/document/template-structure/
* @package WooCommerce\Templates\Emails\Plain
* @version 9.9.0
*/
use Automattic\WooCommerce\Utilities\FeaturesUtil;
defined( 'ABSPATH' ) || exit;
$email_improvements_enabled = FeaturesUtil::feature_is_enabled( 'email_improvements' );
echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n";
echo esc_html( wp_strip_all_tags( $email_heading ) );
echo "\n=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n";
/* translators: %s: Customer first name */
echo sprintf( esc_html__( 'Hi %s,', 'woocommerce' ), esc_html( $order->get_billing_first_name() ) ) . "\n\n";
echo esc_html__( 'We have finished processing your order.', 'woocommerce' ) . "\n\n";
if ( $email_improvements_enabled ) {
echo esc_html__( 'Heres a reminder of what youve ordered:', 'woocommerce' ) . "\n\n";
}
/*
* @hooked WC_Emails::order_details() Shows the order details table.
* @hooked WC_Structured_Data::generate_order_data() Generates structured data.
* @hooked WC_Structured_Data::output_structured_data() Outputs structured data.
* @since 2.5.0
*/
do_action( 'woocommerce_email_order_details', $order, $sent_to_admin, $plain_text, $email );
echo "\n----------------------------------------\n\n";
/*
* @hooked WC_Emails::order_meta() Shows order meta data.
*/
do_action( 'woocommerce_email_order_meta', $order, $sent_to_admin, $plain_text, $email );
/*
* @hooked WC_Emails::customer_details() Shows customer details
* @hooked WC_Emails::email_address() Shows email address
*/
do_action( 'woocommerce_email_customer_details', $order, $sent_to_admin, $plain_text, $email );
echo "\n\n----------------------------------------\n\n";
/**
* Show user-defined additional content - this is set in each email's settings.
*/
if ( $additional_content ) {
echo esc_html( wp_strip_all_tags( wptexturize( $additional_content ) ) );
echo "\n\n----------------------------------------\n\n";
}
echo wp_kses_post( apply_filters( 'woocommerce_email_footer_text', get_option( 'woocommerce_email_footer_text' ) ) );

View File

@@ -0,0 +1,75 @@
<?php
/**
* Customer failed order email (plain text)
*
* This template can be overridden by copying it to yourtheme/woocommerce/emails/plain/customer-failed-order.php.
*
* HOWEVER, on occasion WooCommerce will need to update template files and you
* (the theme developer) will need to copy the new files to your theme to
* maintain compatibility. We try to do this as little as possible, but it does
* happen. When this occurs the version of the template file will be bumped and
* the readme will list any important changes.
*
* @see https://woocommerce.com/document/template-structure/
* @package WooCommerce\Templates\Emails\Plain
* @version 9.8.0
*/
defined( 'ABSPATH' ) || exit;
echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n";
echo esc_html( wp_strip_all_tags( $email_heading ) );
echo "\n=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n";
/* translators: %s: Customer first name */
echo sprintf( esc_html__( 'Hi %s,', 'woocommerce' ), esc_html( $order->get_billing_first_name() ) ) . "\n\n";
echo esc_html__( "Unfortunately, we couldn't complete your order due to an issue with your payment method.", 'woocommerce' ) . "\n\n";
/* translators: %s: Site title */
echo sprintf( esc_html__( "If you'd like to continue with your purchase, please return to %s and try a different method of payment.", 'woocommerce' ), esc_html( $blogname ) ) . "\n\n";
echo esc_html__( 'Your order details are as follows:', 'woocommerce' ) . "\n\n";
/**
* Hook for the woocommerce_email_order_details.
*
* @hooked WC_Emails::order_details() Shows the order details table.
* @hooked WC_Structured_Data::generate_order_data() Generates structured data.
* @hooked WC_Structured_Data::output_structured_data() Outputs structured data.
* @since 2.5.0
*/
do_action( 'woocommerce_email_order_details', $order, $sent_to_admin, $plain_text, $email );
echo "\n----------------------------------------\n\n";
/**
* Hook for the woocommerce_email_order_meta.
*
* @hooked WC_Emails::order_meta() Shows order meta data.
* @since 1.0.0
*/
do_action( 'woocommerce_email_order_meta', $order, $sent_to_admin, $plain_text, $email );
/**
* Hook for woocommerce_email_customer_details.
*
* @hooked WC_Emails::customer_details() Shows customer details
* @hooked WC_Emails::email_address() Shows email address
* @since 1.0.0
*/
do_action( 'woocommerce_email_customer_details', $order, $sent_to_admin, $plain_text, $email );
echo "\n\n----------------------------------------\n\n";
/**
* Show user-defined additional content - this is set in each email's settings.
*/
if ( $additional_content ) {
echo esc_html( wp_strip_all_tags( wptexturize( $additional_content ) ) );
echo "\n\n----------------------------------------\n\n";
}
/**
* Filters the email footer text.
*
* @since 3.7.0
*/
echo wp_kses_post( apply_filters( 'woocommerce_email_footer_text', get_option( 'woocommerce_email_footer_text' ) ) );

View File

@@ -0,0 +1,73 @@
<?php
/**
* Customer fulfillment created email (plain text)
*
* This template can be overridden by copying it to yourtheme/woocommerce/emails/plain/customer-fulfillment-created.php.
*
* HOWEVER, on occasion WooCommerce will need to update template files and you
* (the theme developer) will need to copy the new files to your theme to
* maintain compatibility. We try to do this as little as possible, but it does
* happen. When this occurs the version of the template file will be bumped and
* the readme will list any important changes.
*
* @see https://woocommerce.com/document/template-structure/
* @package WooCommerce\Templates\Emails\Plain
* @version 10.1.0
*/
defined( 'ABSPATH' ) || exit;
echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n";
echo esc_html( wp_strip_all_tags( $email_heading ) );
echo "\n=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n";
echo esc_html__( 'Woo! Some items you purchased are being fulfilled. You can use the below information to track your shipment:', 'woocommerce' ) . "\n\n";
/**
* Display fulfillment details.
*
* @hooked WC_Emails::fulfillment_details() Shows the order details table.
* @hooked WC_Structured_Data::generate_order_data() Generates structured data.
* @hooked WC_Structured_Data::output_structured_data() Outputs structured data.
*
* @since 10.1.0
*/
do_action( 'woocommerce_email_fulfillment_details', $order, $fulfillment, $sent_to_admin, $plain_text, $email );
echo "\n----------------------------------------\n\n";
/**
* Display fulfillment meta data.
*
* @hooked WC_Emails::fulfillment_meta() Shows order meta data.
*
* @since 10.1.0
*/
do_action( 'woocommerce_email_fulfillment_meta', $order, $fulfillment, $sent_to_admin, $plain_text, $email );
/**
* Display customer details and email address.
*
* @hooked WC_Emails::customer_details() Shows customer details
* @hooked WC_Emails::email_address() Shows email address
*
* @since 2.5.0
*/
do_action( 'woocommerce_email_customer_details', $order, $sent_to_admin, $plain_text, $email );
echo "\n\n----------------------------------------\n\n";
/**
* Show user-defined additional content - this is set in each email's settings.
*/
if ( $additional_content ) {
echo esc_html( wp_strip_all_tags( wptexturize( $additional_content ) ) );
echo "\n\n----------------------------------------\n\n";
}
/**
* Display the email footer text.
*
* @since 2.5.0
*/
echo wp_kses_post( apply_filters( 'woocommerce_email_footer_text', get_option( 'woocommerce_email_footer_text' ) ) );

View File

@@ -0,0 +1,73 @@
<?php
/**
* Customer fulfillment deleted email (plain text)
*
* This template can be overridden by copying it to yourtheme/woocommerce/emails/plain/customer-fulfillment-deleted.php.
*
* HOWEVER, on occasion WooCommerce will need to update template files and you
* (the theme developer) will need to copy the new files to your theme to
* maintain compatibility. We try to do this as little as possible, but it does
* happen. When this occurs the version of the template file will be bumped and
* the readme will list any important changes.
*
* @see https://woocommerce.com/document/template-structure/
* @package WooCommerce\Templates\Emails\Plain
* @version 10.1.0
*/
defined( 'ABSPATH' ) || exit;
echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n";
echo esc_html( wp_strip_all_tags( $email_heading ) );
echo "\n=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n";
echo esc_html__( 'We wanted to let you know that one of the previously fulfilled shipments from your order has been removed from our system. This may have been due to a correction or an update in our fulfillment records. Dont worry — this wont affect any items youve already received.', 'woocommerce' ) . "\n\n";
/**
* Display fulfillment details.
*
* @hooked WC_Emails::fulfillment_details() Shows the order details table.
* @hooked WC_Structured_Data::generate_order_data() Generates structured data.
* @hooked WC_Structured_Data::output_structured_data() Outputs structured data.
*
* @since 10.1.0
*/
do_action( 'woocommerce_email_fulfillment_details', $order, $fulfillment, $sent_to_admin, $plain_text, $email );
echo "\n----------------------------------------\n\n";
/**
* Display fulfillment meta data.
*
* @hooked WC_Emails::fulfillment_meta() Shows order meta data.
*
* @since 10.1.0
*/
do_action( 'woocommerce_email_fulfillment_meta', $order, $fulfillment, $sent_to_admin, $plain_text, $email );
/**
* Display customer details and email address.
*
* @hooked WC_Emails::customer_details() Shows customer details
* @hooked WC_Emails::email_address() Shows email address
*
* @since 2.5.0
*/
do_action( 'woocommerce_email_customer_details', $order, $sent_to_admin, $plain_text, $email );
echo "\n\n----------------------------------------\n\n";
/**
* Show user-defined additional content - this is set in each email's settings.
*/
if ( $additional_content ) {
echo esc_html( wp_strip_all_tags( wptexturize( $additional_content ) ) );
echo "\n\n----------------------------------------\n\n";
}
/**
* Display the email footer text.
*
* @since 2.5.0
*/
echo wp_kses_post( apply_filters( 'woocommerce_email_footer_text', get_option( 'woocommerce_email_footer_text' ) ) );

View File

@@ -0,0 +1,75 @@
<?php
/**
* Customer fulfillment updated email (plain text)
*
* This template can be overridden by copying it to yourtheme/woocommerce/emails/plain/customer-fulfillment-updated.php.
*
* HOWEVER, on occasion WooCommerce will need to update template files and you
* (the theme developer) will need to copy the new files to your theme to
* maintain compatibility. We try to do this as little as possible, but it does
* happen. When this occurs the version of the template file will be bumped and
* the readme will list any important changes.
*
* @see https://woocommerce.com/document/template-structure/
* @package WooCommerce\Templates\Emails\Plain
* @version 10.1.0
*/
defined( 'ABSPATH' ) || exit;
echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n";
echo esc_html( wp_strip_all_tags( $email_heading ) );
echo "\n=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n";
/* translators: %s: Customer first name */
echo esc_html__( 'Some details of your shipment have recently been updated. This may include tracking information, item contents, or delivery status.', 'woocommerce' ) . "\n\n";
echo esc_html__( 'Heres the latest info we have:', 'woocommerce' ) . "\n\n";
/**
* Display fulfillment details.
*
* @hooked WC_Emails::fulfillment_details() Shows the order details table.
* @hooked WC_Structured_Data::generate_order_data() Generates structured data.
* @hooked WC_Structured_Data::output_structured_data() Outputs structured data.
*
* @since 10.1.0
*/
do_action( 'woocommerce_email_fulfillment_details', $order, $fulfillment, $sent_to_admin, $plain_text, $email );
echo "\n----------------------------------------\n\n";
/**
* Display fulfillment meta data.
*
* @hooked WC_Emails::fulfillment_meta() Shows order meta data.
*
* @since 10.1.0
*/
do_action( 'woocommerce_email_fulfillment_meta', $order, $fulfillment, $sent_to_admin, $plain_text, $email );
/**
* Display customer details and email address.
*
* @hooked WC_Emails::customer_details() Shows customer details
* @hooked WC_Emails::email_address() Shows email address
*
* @since 2.5.0
*/
do_action( 'woocommerce_email_customer_details', $order, $sent_to_admin, $plain_text, $email );
echo "\n\n----------------------------------------\n\n";
/**
* Show user-defined additional content - this is set in each email's settings.
*/
if ( $additional_content ) {
echo esc_html( wp_strip_all_tags( wptexturize( $additional_content ) ) );
echo "\n\n----------------------------------------\n\n";
}
/**
* Display the email footer text.
*
* @since 2.5.0
*/
echo wp_kses_post( apply_filters( 'woocommerce_email_footer_text', get_option( 'woocommerce_email_footer_text' ) ) );

View File

@@ -0,0 +1,95 @@
<?php
/**
* Customer invoice email (plain text)
*
* This template can be overridden by copying it to yourtheme/woocommerce/emails/plain/customer-invoice.php.
*
* HOWEVER, on occasion WooCommerce will need to update template files and you
* (the theme developer) will need to copy the new files to your theme to
* maintain compatibility. We try to do this as little as possible, but it does
* happen. When this occurs the version of the template file will be bumped and
* the readme will list any important changes.
*
* @see https://woocommerce.com/document/template-structure/
* @package WooCommerce\Templates\Emails\Plain
* @version 9.7.0
*/
// phpcs:disable Universal.WhiteSpace.PrecisionAlignment.Found, Generic.WhiteSpace.DisallowSpaceIndent.SpacesUsed -- Plain text output needs specific spacing without tabs
use Automattic\WooCommerce\Enums\OrderStatus;
defined( 'ABSPATH' ) || exit;
echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n";
echo esc_html( wp_strip_all_tags( $email_heading ) );
echo "\n=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n";
/* translators: %s: Customer first name */
echo sprintf( esc_html__( 'Hi %s,', 'woocommerce' ), esc_html( $order->get_billing_first_name() ) ) . "\n\n";
if ( $order->needs_payment() ) {
if ( $order->has_status( OrderStatus::FAILED ) ) {
echo wp_kses_post(
sprintf(
/* translators: %1$s: Site title, %2$s: Order pay link */
__( 'Sorry, your order on %1$s was unsuccessful. Your order details are below, with a link to try your payment again: %2$s', 'woocommerce' ),
esc_html( get_bloginfo( 'name', 'display' ) ),
esc_url( $order->get_checkout_payment_url() )
)
) . "\n\n";
} else {
echo wp_kses_post(
sprintf(
/* translators: %1$s: Site title, %2$s: Order pay link */
__( 'An order has been created for you on %1$s. Your order details are below, with a link to make payment when youre ready: %2$s', 'woocommerce' ),
esc_html( get_bloginfo( 'name', 'display' ) ),
esc_url( $order->get_checkout_payment_url() )
)
) . "\n\n";
}
} else {
/* translators: %s: Order date */
echo sprintf( esc_html__( 'Here are the details of your order placed on %s:', 'woocommerce' ), esc_html( wc_format_datetime( $order->get_date_created() ) ) ) . "\n\n";
}
/**
* Hook for the woocommerce_email_order_details.
*
* @hooked WC_Emails::order_details() Shows the order details table.
* @hooked WC_Structured_Data::generate_order_data() Generates structured data.
* @hooked WC_Structured_Data::output_structured_data() Outputs structured data.
* @since 2.5.0
*/
do_action( 'woocommerce_email_order_details', $order, $sent_to_admin, $plain_text, $email );
echo "\n----------------------------------------\n\n";
/**
* Hook for the woocommerce_email_order_meta.
*
* @hooked WC_Emails::order_meta() Shows order meta data.
*/
do_action( 'woocommerce_email_order_meta', $order, $sent_to_admin, $plain_text, $email );
/**
* Hook for woocommerce_email_customer_details
*
* @hooked WC_Emails::customer_details() Shows customer details
* @hooked WC_Emails::email_address() Shows email address
*/
do_action( 'woocommerce_email_customer_details', $order, $sent_to_admin, $plain_text, $email );
echo "\n\n----------------------------------------\n\n";
/**
* Show user-defined additional content - this is set in each email's settings.
*/
if ( $additional_content ) {
echo esc_html( wp_strip_all_tags( wptexturize( $additional_content ) ) );
echo "\n\n----------------------------------------\n\n";
}
echo wp_kses_post( apply_filters( 'woocommerce_email_footer_text', get_option( 'woocommerce_email_footer_text' ) ) );
// phpcs:enable Universal.WhiteSpace.PrecisionAlignment.Found, Generic.WhiteSpace.DisallowSpaceIndent.SpacesUsed

View File

@@ -0,0 +1,61 @@
<?php
/**
* Customer new account email
*
* This template can be overridden by copying it to yourtheme/woocommerce/emails/plain/customer-new-account.php.
*
* HOWEVER, on occasion WooCommerce will need to update template files and you
* (the theme developer) will need to copy the new files to your theme to
* maintain compatibility. We try to do this as little as possible, but it does
* happen. When this occurs the version of the template file will be bumped and
* the readme will list any important changes.
*
* @see https://woocommerce.com/document/template-structure/
* @package WooCommerce\Templates\Emails\Plain
* @version 10.0.0
*/
use Automattic\WooCommerce\Utilities\FeaturesUtil;
defined( 'ABSPATH' ) || exit;
$email_improvements_enabled = FeaturesUtil::feature_is_enabled( 'email_improvements' );
echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n";
echo esc_html( wp_strip_all_tags( $email_heading ) );
echo "\n=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n";
/* translators: %s: Customer username */
echo sprintf( esc_html__( 'Hi %s,', 'woocommerce' ), esc_html( $user_login ) ) . "\n\n";
if ( $email_improvements_enabled ) {
/* translators: %s: Site title */
echo sprintf( esc_html__( 'Thanks for creating an account on %s. Heres a copy of your user details.', 'woocommerce' ), esc_html( $blogname ) ) . "\n\n";
echo "----------------------------------------\n\n";
/* translators: %s: Username */
echo sprintf( esc_html__( 'Username: %s.', 'woocommerce' ), esc_html( $user_login ) ) . "\n\n";
echo "----------------------------------------\n\n";
echo esc_html__( 'You can access your account area to view orders, change your password, and more via the link below:', 'woocommerce' ) . "\n\n";
echo esc_html( wc_get_page_permalink( 'myaccount' ) ) . "\n\n";
} else {
/* translators: %1$s: Site title, %2$s: Username, %3$s: My account link */
echo sprintf( esc_html__( 'Thanks for creating an account on %1$s. Your username is %2$s. You can access your account area to view orders, change your password, and more at: %3$s', 'woocommerce' ), esc_html( $blogname ), esc_html( $user_login ), esc_html( wc_get_page_permalink( 'myaccount' ) ) ) . "\n\n";
}
// Only send the set new password link if the user hasn't set their password during sign-up.
if ( $password_generated && $set_password_url ) {
/* translators: URL follows */
echo esc_html__( 'To set your password, visit the following address: ', 'woocommerce' ) . "\n\n";
echo esc_html( $set_password_url ) . "\n\n";
}
echo "\n\n----------------------------------------\n\n";
/**
* Show user-defined additional content - this is set in each email's settings.
*/
if ( $additional_content ) {
echo esc_html( wp_strip_all_tags( wptexturize( $additional_content ) ) );
echo "\n\n----------------------------------------\n\n";
}
echo wp_kses_post( apply_filters( 'woocommerce_email_footer_text', get_option( 'woocommerce_email_footer_text' ) ) );

View File

@@ -0,0 +1,67 @@
<?php
/**
* Customer note email
*
* This template can be overridden by copying it to yourtheme/woocommerce/emails/plain/customer-note.php.
*
* HOWEVER, on occasion WooCommerce will need to update template files and you
* (the theme developer) will need to copy the new files to your theme to
* maintain compatibility. We try to do this as little as possible, but it does
* happen. When this occurs the version of the template file will be bumped and
* the readme will list any important changes.
*
* @see https://woocommerce.com/document/template-structure/
* @package WooCommerce\Templates\Emails\Plain
* @version 10.1.0
*/
defined( 'ABSPATH' ) || exit;
echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n";
echo esc_html( wp_strip_all_tags( $email_heading ) );
echo "\n=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n";
/* translators: %s: Customer first name */
echo sprintf( esc_html__( 'Hi %s,', 'woocommerce' ), esc_html( $order->get_billing_first_name() ) ) . "\n\n";
echo esc_html__( 'The following note has been added to your order:', 'woocommerce' ) . "\n\n";
echo "----------\n\n";
echo wc_wptexturize_order_note( $customer_note ) . "\n\n"; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
echo "----------\n\n";
echo esc_html__( 'As a reminder, here are your order details:', 'woocommerce' ) . "\n\n";
/*
* @hooked WC_Emails::order_details() Shows the order details table.
* @hooked WC_Structured_Data::generate_order_data() Generates structured data.
* @hooked WC_Structured_Data::output_structured_data() Outputs structured data.
* @since 2.5.0
*/
do_action( 'woocommerce_email_order_details', $order, $sent_to_admin, $plain_text, $email );
echo "\n----------------------------------------\n\n";
/*
* @hooked WC_Emails::order_meta() Shows order meta data.
*/
do_action( 'woocommerce_email_order_meta', $order, $sent_to_admin, $plain_text, $email );
/*
* @hooked WC_Emails::customer_details() Shows customer details
* @hooked WC_Emails::email_address() Shows email address
*/
do_action( 'woocommerce_email_customer_details', $order, $sent_to_admin, $plain_text, $email );
echo "\n\n----------------------------------------\n\n";
/**
* Show user-defined additional content - this is set in each email's settings.
*/
if ( $additional_content ) {
echo esc_html( wp_strip_all_tags( wptexturize( $additional_content ) ) );
echo "\n\n----------------------------------------\n\n";
}
echo wp_kses_post( apply_filters( 'woocommerce_email_footer_text', get_option( 'woocommerce_email_footer_text' ) ) );

View File

@@ -0,0 +1,68 @@
<?php
/**
* Customer on-hold order email
*
* This template can be overridden by copying it to yourtheme/woocommerce/emails/plain/customer-on-hold-order.php.
*
* HOWEVER, on occasion WooCommerce will need to update template files and you
* (the theme developer) will need to copy the new files to your theme to
* maintain compatibility. We try to do this as little as possible, but it does
* happen. When this occurs the version of the template file will be bumped and
* the readme will list any important changes.
*
* @see https://woocommerce.com/document/template-structure/
* @package WooCommerce\Templates\Emails\Plain
* @version 9.8.0
*/
use Automattic\WooCommerce\Utilities\FeaturesUtil;
defined( 'ABSPATH' ) || exit;
$email_improvements_enabled = FeaturesUtil::feature_is_enabled( 'email_improvements' );
echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n";
echo esc_html( wp_strip_all_tags( $email_heading ) );
echo "\n=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n";
/* translators: %s: Customer first name */
echo sprintf( esc_html__( 'Hi %s,', 'woocommerce' ), esc_html( $order->get_billing_first_name() ) ) . "\n\n";
if ( $email_improvements_enabled ) {
echo esc_html__( 'Weve received your order and its currently on hold until we can confirm your payment has been processed.', 'woocommerce' ) . "\n\n";
echo esc_html__( 'Heres a reminder of what youve ordered:', 'woocommerce' ) . "\n\n";
} else {
echo esc_html__( 'Thanks for your order. Its on-hold until we confirm that payment has been received.', 'woocommerce' ) . "\n\n";
}
/*
* @hooked WC_Emails::order_details() Shows the order details table.
* @hooked WC_Structured_Data::generate_order_data() Generates structured data.
* @hooked WC_Structured_Data::output_structured_data() Outputs structured data.
* @since 2.5.0
*/
do_action( 'woocommerce_email_order_details', $order, $sent_to_admin, $plain_text, $email );
echo "\n----------------------------------------\n\n";
/*
* @hooked WC_Emails::order_meta() Shows order meta data.
*/
do_action( 'woocommerce_email_order_meta', $order, $sent_to_admin, $plain_text, $email );
/*
* @hooked WC_Emails::customer_details() Shows customer details
* @hooked WC_Emails::email_address() Shows email address
*/
do_action( 'woocommerce_email_customer_details', $order, $sent_to_admin, $plain_text, $email );
echo "\n\n----------------------------------------\n\n";
/**
* Show user-defined additional content - this is set in each email's settings.
*/
if ( $additional_content ) {
echo esc_html( wp_strip_all_tags( wptexturize( $additional_content ) ) );
echo "\n\n----------------------------------------\n\n";
}
echo wp_kses_post( apply_filters( 'woocommerce_email_footer_text', get_option( 'woocommerce_email_footer_text' ) ) );

View File

@@ -0,0 +1,109 @@
<?php
/**
* Customer POS completed order email (plain text)
*
* This template can be overridden by copying it to yourtheme/woocommerce/emails/plain/customer-pos-completed-order.php.
*
* HOWEVER, on occasion WooCommerce will need to update template files and you
* (the theme developer) will need to copy the new files to your theme to
* maintain compatibility. We try to do this as little as possible, but it does
* happen. When this occurs the version of the template file will be bumped and
* the readme will list any important changes.
*
* @see https://woocommerce.com/document/template-structure/
* @package WooCommerce\Templates\Emails\Plain
* @version 10.0.0
*/
use Automattic\WooCommerce\Utilities\FeaturesUtil;
defined( 'ABSPATH' ) || exit;
$email_improvements_enabled = FeaturesUtil::feature_is_enabled( 'email_improvements' );
$email = $email ?? null;
echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n";
echo esc_html( wp_strip_all_tags( $email_heading ) );
echo "\n=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n";
if ( ! empty( $order->get_billing_first_name() ) ) {
/* translators: %s: Customer first name */
echo sprintf( esc_html__( 'Hi %s,', 'woocommerce' ), esc_html( $order->get_billing_first_name() ) ) . "\n\n";
} else {
echo esc_html__( 'Hi there,', 'woocommerce' ) . "\n\n";
}
echo esc_html__( 'Heres a reminder of what youve ordered:', 'woocommerce' ) . "\n\n";
/**
* Show the order details table, generate and output structured data.
*
* @hooked WC_Emails::order_details() Shows the order details table.
* @hooked WC_Structured_Data::generate_order_data() Generates structured data.
* @hooked WC_Structured_Data::output_structured_data() Outputs structured data.
* @since 2.5.0
*/
do_action( 'woocommerce_email_order_details', $order, $sent_to_admin, $plain_text, $email );
echo "\n----------------------------------------\n\n";
/**
* Show order meta data.
*
* @hooked WC_Emails::order_meta() Shows order meta data.
* @since 1.0.0
*/
do_action( 'woocommerce_email_order_meta', $order, $sent_to_admin, $plain_text, $email );
/**
* Show customer details and email address.
*
* @hooked WC_Emails::customer_details() Shows customer details
* @hooked WC_Emails::email_address() Shows email address
* @since 1.0.0
*/
do_action( 'woocommerce_email_customer_details', $order, $sent_to_admin, $plain_text, $email );
echo "\n\n----------------------------------------\n\n";
/**
* Show user-defined additional content - this is set in each email's settings.
*/
if ( $additional_content ) {
echo esc_html( wp_strip_all_tags( wptexturize( $additional_content ) ) );
echo "\n\n----------------------------------------\n\n";
}
/**
* Show store information - store details are set in the Point of Sale settings.
*/
if ( ! empty( $pos_store_email ) || ! empty( $pos_store_phone_number ) || ! empty( $pos_store_address ) ) {
if ( ! empty( $pos_store_name ) ) {
echo "\n" . esc_html( $pos_store_name ) . "\n\n";
}
if ( ! empty( $pos_store_email ) ) {
echo esc_html( $pos_store_email ) . "\n";
}
if ( ! empty( $pos_store_phone_number ) ) {
echo esc_html( $pos_store_phone_number ) . "\n";
}
if ( ! empty( $pos_store_address ) ) {
echo esc_html( wp_strip_all_tags( wptexturize( $pos_store_address ) ) ) . "\n";
}
echo "\n----------------------------------------\n\n";
}
/**
* Show refund & returns policy - this is set in the Point of Sale settings.
*/
if ( ! empty( $pos_refund_returns_policy ) ) {
echo "\n" . esc_html__( 'Refund & Returns Policy', 'woocommerce' ) . "\n\n";
echo esc_html( wp_strip_all_tags( wptexturize( $pos_refund_returns_policy ) ) ) . "\n";
echo "\n----------------------------------------\n\n";
}
/**
* Filter the email footer text.
*
* @since 4.0.0
*/
echo wp_kses_post( apply_filters( 'woocommerce_email_footer_text', get_option( 'woocommerce_email_footer_text' ), $email ) );

View File

@@ -0,0 +1,116 @@
<?php
/**
* Customer POS refunded order email (plain text)
*
* This template can be overridden by copying it to yourtheme/woocommerce/emails/plain/customer-pos-refunded-order.php.
*
* HOWEVER, on occasion WooCommerce will need to update template files and you
* (the theme developer) will need to copy the new files to your theme to
* maintain compatibility. We try to do this as little as possible, but it does
* happen. When this occurs the version of the template file will be bumped and
* the readme will list any important changes.
*
* @see https://woocommerce.com/document/template-structure/
* @package WooCommerce\Templates\Emails\Plain
* @version 10.0.0
*/
use Automattic\WooCommerce\Utilities\FeaturesUtil;
defined( 'ABSPATH' ) || exit;
$email_improvements_enabled = FeaturesUtil::feature_is_enabled( 'email_improvements' );
$email = $email ?? null;
echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n";
echo esc_html( wp_strip_all_tags( $email_heading ) );
echo "\n=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n";
if ( ! empty( $order->get_billing_first_name() ) ) {
/* translators: %s: Customer first name */
echo sprintf( esc_html__( 'Hi %s,', 'woocommerce' ), esc_html( $order->get_billing_first_name() ) ) . "\n\n";
} else {
echo esc_html__( 'Hi there,', 'woocommerce' ) . "\n\n";
}
if ( $partial_refund ) {
/* translators: %s: Site title */
echo sprintf( esc_html__( 'Your order from %s has been partially refunded.', 'woocommerce' ), esc_html( $pos_store_name ) ) . "\n\n";
} else {
/* translators: %s: Site title */
echo sprintf( esc_html__( 'Your order from %s has been refunded.', 'woocommerce' ), esc_html( $pos_store_name ) ) . "\n\n";
}
echo esc_html__( 'Heres a reminder of what youve bought:', 'woocommerce' ) . "\n\n";
/**
* Show order details.
*
* @hooked WC_Emails::order_details() Shows the order details table.
* @hooked WC_Structured_Data::generate_order_data() Generates structured data.
* @hooked WC_Structured_Data::output_structured_data() Outputs structured data.
* @since 2.5.0
*/
do_action( 'woocommerce_email_order_details', $order, $sent_to_admin, $plain_text, $email );
echo "\n----------------------------------------\n\n";
/**
* Show order meta data.
*
* @hooked WC_Emails::order_meta() Shows order meta data.
* @since 1.0.0
*/
do_action( 'woocommerce_email_order_meta', $order, $sent_to_admin, $plain_text, $email );
/**
* Show customer details and email address.
*
* @hooked WC_Emails::customer_details() Shows customer details
* @hooked WC_Emails::email_address() Shows email address
* @since 1.0.0
*/
do_action( 'woocommerce_email_customer_details', $order, $sent_to_admin, $plain_text, $email );
echo "\n\n----------------------------------------\n\n";
/**
* Show user-defined additional content - this is set in each email's settings.
*/
if ( $additional_content ) {
echo esc_html( wp_strip_all_tags( wptexturize( $additional_content ) ) );
echo "\n\n----------------------------------------\n\n";
}
/**
* Show store information - store details are set in the Point of Sale settings.
*/
if ( ! empty( $pos_store_email ) || ! empty( $pos_store_phone_number ) || ! empty( $pos_store_address ) ) {
if ( ! empty( $pos_store_name ) ) {
echo "\n" . esc_html( $pos_store_name ) . "\n\n";
}
if ( ! empty( $pos_store_email ) ) {
echo esc_html( $pos_store_email ) . "\n";
}
if ( ! empty( $pos_store_phone_number ) ) {
echo esc_html( $pos_store_phone_number ) . "\n";
}
if ( ! empty( $pos_store_address ) ) {
echo esc_html( wp_strip_all_tags( wptexturize( $pos_store_address ) ) ) . "\n";
}
echo "\n----------------------------------------\n\n";
}
/**
* Show refund & returns policy - this is set in the Point of Sale settings.
*/
if ( ! empty( $pos_refund_returns_policy ) ) {
echo "\n" . esc_html__( 'Refund & Returns Policy', 'woocommerce' ) . "\n\n";
echo esc_html( wp_strip_all_tags( wptexturize( $pos_refund_returns_policy ) ) ) . "\n";
echo "\n----------------------------------------\n\n";
}
/**
* Filter the email footer text.
*
* @since 4.0.0
*/
echo wp_kses_post( apply_filters( 'woocommerce_email_footer_text', get_option( 'woocommerce_email_footer_text' ), $email ) );

View File

@@ -0,0 +1,69 @@
<?php
/**
* Customer processing order email
*
* This template can be overridden by copying it to yourtheme/woocommerce/emails/plain/customer-processing-order.php.
*
* HOWEVER, on occasion WooCommerce will need to update template files and you
* (the theme developer) will need to copy the new files to your theme to
* maintain compatibility. We try to do this as little as possible, but it does
* happen. When this occurs the version of the template file will be bumped and
* the readme will list any important changes.
*
* @see https://woocommerce.com/document/template-structure/
* @package WooCommerce\Templates\Emails\Plain
* @version 9.9.0
*/
use Automattic\WooCommerce\Utilities\FeaturesUtil;
defined( 'ABSPATH' ) || exit;
$email_improvements_enabled = FeaturesUtil::feature_is_enabled( 'email_improvements' );
echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n";
echo esc_html( wp_strip_all_tags( $email_heading ) );
echo "\n=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n";
/* translators: %s: Customer first name */
echo sprintf( esc_html__( 'Hi %s,', 'woocommerce' ), esc_html( $order->get_billing_first_name() ) ) . "\n\n";
if ( $email_improvements_enabled ) {
echo esc_html__( 'Just to let you know &mdash; weve received your order, and it is now being processed.', 'woocommerce' ) . "\n\n";
echo esc_html__( 'Heres a reminder of what youve ordered:', 'woocommerce' ) . "\n\n";
} else {
/* translators: %s: Order number */
echo sprintf( esc_html__( 'Just to let you know &mdash; we\'ve received your order #%s, and it is now being processed:', 'woocommerce' ), esc_html( $order->get_order_number() ) ) . "\n\n";
}
/*
* @hooked WC_Emails::order_details() Shows the order details table.
* @hooked WC_Structured_Data::generate_order_data() Generates structured data.
* @hooked WC_Structured_Data::output_structured_data() Outputs structured data.
* @since 2.5.0
*/
do_action( 'woocommerce_email_order_details', $order, $sent_to_admin, $plain_text, $email );
echo "\n----------------------------------------\n\n";
/*
* @hooked WC_Emails::order_meta() Shows order meta data.
*/
do_action( 'woocommerce_email_order_meta', $order, $sent_to_admin, $plain_text, $email );
/*
* @hooked WC_Emails::customer_details() Shows customer details
* @hooked WC_Emails::email_address() Shows email address
*/
do_action( 'woocommerce_email_customer_details', $order, $sent_to_admin, $plain_text, $email );
echo "\n\n----------------------------------------\n\n";
/**
* Show user-defined additional content - this is set in each email's settings.
*/
if ( $additional_content ) {
echo esc_html( wp_strip_all_tags( wptexturize( $additional_content ) ) );
echo "\n\n----------------------------------------\n\n";
}
echo wp_kses_post( apply_filters( 'woocommerce_email_footer_text', get_option( 'woocommerce_email_footer_text' ) ) );

View File

@@ -0,0 +1,78 @@
<?php
/**
* Customer refunded order email (plain text)
*
* This template can be overridden by copying it to yourtheme/woocommerce/emails/plain/customer-refunded-order.php.
*
* HOWEVER, on occasion WooCommerce will need to update template files and you
* (the theme developer) will need to copy the new files to your theme to
* maintain compatibility. We try to do this as little as possible, but it does
* happen. When this occurs the version of the template file will be bumped and
* the readme will list any important changes.
*
* @see https://woocommerce.com/document/template-structure/
* @package WooCommerce\Templates\Emails\Plain
* @version 9.8.0
*/
use Automattic\WooCommerce\Utilities\FeaturesUtil;
defined( 'ABSPATH' ) || exit;
$email_improvements_enabled = FeaturesUtil::feature_is_enabled( 'email_improvements' );
echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n";
echo esc_html( wp_strip_all_tags( $email_heading ) );
echo "\n=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n";
/* translators: %s: Customer first name */
echo sprintf( esc_html__( 'Hi %s,', 'woocommerce' ), esc_html( $order->get_billing_first_name() ) ) . "\n\n";
if ( $email_improvements_enabled ) {
if ( $partial_refund ) {
/* translators: %s: Site title */
echo sprintf( esc_html__( 'Your order from %s has been partially refunded.', 'woocommerce' ), esc_html( $blogname ) ) . "\n\n";
} else {
/* translators: %s: Site title */
echo sprintf( esc_html__( 'Your order from %s has been refunded.', 'woocommerce' ), esc_html( $blogname ) ) . "\n\n";
}
echo esc_html__( 'Heres a reminder of what youve ordered:', 'woocommerce' ) . "\n\n";
} elseif ( $partial_refund ) {
/* translators: %s: Site title */
echo sprintf( esc_html__( 'Your order on %s has been partially refunded. There are more details below for your reference:', 'woocommerce' ), esc_html( $blogname ) ) . "\n\n";
} else {
/* translators: %s: Site title */
echo sprintf( esc_html__( 'Your order on %s has been refunded. There are more details below for your reference:', 'woocommerce' ), esc_html( $blogname ) ) . "\n\n";
}
/*
* @hooked WC_Emails::order_details() Shows the order details table.
* @hooked WC_Structured_Data::generate_order_data() Generates structured data.
* @hooked WC_Structured_Data::output_structured_data() Outputs structured data.
* @since 2.5.0
*/
do_action( 'woocommerce_email_order_details', $order, $sent_to_admin, $plain_text, $email );
echo "\n----------------------------------------\n\n";
/*
* @hooked WC_Emails::order_meta() Shows order meta data.
*/
do_action( 'woocommerce_email_order_meta', $order, $sent_to_admin, $plain_text, $email );
/*
* @hooked WC_Emails::customer_details() Shows customer details
* @hooked WC_Emails::email_address() Shows email address
*/
do_action( 'woocommerce_email_customer_details', $order, $sent_to_admin, $plain_text, $email );
echo "\n\n----------------------------------------\n\n";
/**
* Show user-defined additional content - this is set in each email's settings.
*/
if ( $additional_content ) {
echo esc_html( wp_strip_all_tags( wptexturize( $additional_content ) ) );
echo "\n\n----------------------------------------\n\n";
}
echo wp_kses_post( apply_filters( 'woocommerce_email_footer_text', get_option( 'woocommerce_email_footer_text' ) ) );

View File

@@ -0,0 +1,55 @@
<?php
/**
* Customer Reset Password email
*
* This template can be overridden by copying it to yourtheme/woocommerce/emails/plain/customer-reset-password.php.
*
* HOWEVER, on occasion WooCommerce will need to update template files and you
* (the theme developer) will need to copy the new files to your theme to
* maintain compatibility. We try to do this as little as possible, but it does
* happen. When this occurs the version of the template file will be bumped and
* the readme will list any important changes.
*
* @see https://woocommerce.com/document/template-structure/
* @package WooCommerce\Templates\Emails\Plain
* @version 9.8.0
*/
use Automattic\WooCommerce\Utilities\FeaturesUtil;
defined( 'ABSPATH' ) || exit;
$email_improvements_enabled = FeaturesUtil::feature_is_enabled( 'email_improvements' );
echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n";
echo esc_html( wp_strip_all_tags( $email_heading ) );
echo "\n=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n";
/* translators: %s: Customer username */
echo sprintf( esc_html__( 'Hi %s,', 'woocommerce' ), esc_html( $user_login ) ) . "\n\n";
/* translators: %s: Store name */
echo sprintf( esc_html__( 'Someone has requested a new password for the following account on %s:', 'woocommerce' ), esc_html( $blogname ) ) . "\n\n";
if ( $email_improvements_enabled ) {
echo "----------------------------------------\n\n";
}
/* translators: %s: Customer username */
echo sprintf( esc_html__( 'Username: %s', 'woocommerce' ), esc_html( $user_login ) ) . "\n\n";
if ( $email_improvements_enabled ) {
echo "----------------------------------------\n\n";
echo esc_html__( 'If you didnt make this request, just ignore this email. If youd like to proceed, reset your password via the link below:', 'woocommerce' ) . "\n\n";
} else {
echo esc_html__( 'If you didn\'t make this request, just ignore this email. If you\'d like to proceed:', 'woocommerce' ) . "\n\n";
}
echo esc_url( add_query_arg( array( 'key' => $reset_key, 'id' => $user_id, 'login' => rawurlencode( $user_login ) ), wc_get_endpoint_url( 'lost-password', '', wc_get_page_permalink( 'myaccount' ) ) ) ) . "\n\n"; // phpcs:ignore WordPress.Arrays.ArrayDeclarationSpacing.AssociativeArrayFound
echo "\n\n----------------------------------------\n\n";
/**
* Show user-defined additional content - this is set in each email's settings.
*/
if ( $additional_content ) {
echo esc_html( wp_strip_all_tags( wptexturize( $additional_content ) ) );
echo "\n\n----------------------------------------\n\n";
}
echo wp_kses_post( apply_filters( 'woocommerce_email_footer_text', get_option( 'woocommerce_email_footer_text' ) ) );

View File

@@ -0,0 +1,47 @@
<?php
/**
* Customer Stock Notification Confirm template.
*
* This template can be overridden by copying it to yourtheme/woocommerce/emails/plain/customer-stock-notification-verified.php.
*
* HOWEVER, on occasion WooCommerce will need to update template files and you
* (the theme developer) will need to copy the new files to your theme to
* maintain compatibility. We try to do this as little as possible, but it does
* happen. When this occurs the version of the template file will be bumped and
* the readme will list any important changes.
*
* @see https://woocommerce.com/document/template-structure/
* @package WooCommerce\Templates\Emails\Plain
* @version 10.2.0
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n";
echo esc_html( wp_strip_all_tags( $email_heading ) );
echo "\n=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n";
echo esc_html( wp_strip_all_tags( wptexturize( apply_filters( 'woocommerce_email_intro_content', $intro_content, $notification ) ) ) ); // phpcs:ignore WooCommerce.Commenting.CommentHooks.MissingHookComment
echo "\n\n----------------------------------------\n\n";
/**
* Hook: woocommerce_email_stock_notification_product.
*
* @since 10.2.0
*/
do_action( 'woocommerce_email_stock_notification_product', $product, $notification, true, $email );
/**
* Show user-defined additional content - this is set in each email's settings.
*/
if ( $additional_content ) {
echo esc_html( wp_strip_all_tags( wptexturize( $additional_content ) ) );
echo "\n\n----------------------------------------\n\n";
}
echo wp_kses_post( apply_filters( 'woocommerce_email_footer_text', get_option( 'woocommerce_email_footer_text' ) ) ); // phpcs:ignore WooCommerce.Commenting.CommentHooks.MissingHookComment

View File

@@ -0,0 +1,47 @@
<?php
/**
* Back in Stock Notification Verify template.
*
* This template can be overridden by copying it to yourtheme/woocommerce/emails/plain/customer-stock-notification-verify.php.
*
* HOWEVER, on occasion WooCommerce will need to update template files and you
* (the theme developer) will need to copy the new files to your theme to
* maintain compatibility. We try to do this as little as possible, but it does
* happen. When this occurs the version of the template file will be bumped and
* the readme will list any important changes.
*
* @see https://woocommerce.com/document/template-structure/
* @package WooCommerce\Templates\Emails\Plain
* @version 10.2.0
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n";
echo esc_html( wp_strip_all_tags( $email_heading ) );
echo "\n=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n";
echo esc_html( wp_strip_all_tags( wptexturize( apply_filters( 'woocommerce_email_intro_content', $intro_content, $notification ) ) ) ); // phpcs:ignore WooCommerce.Commenting.CommentHooks.MissingHookComment
echo "\n\n----------------------------------------\n\n";
/**
* Hook: woocommerce_email_stock_notification_product.
*
* @since 10.2.0
*/
do_action( 'woocommerce_email_stock_notification_product', $product, $notification, true, $email );
/**
* Show user-defined additional content - this is set in each email's settings.
*/
if ( $additional_content ) {
echo esc_html( wp_strip_all_tags( wptexturize( $additional_content ) ) );
echo "\n\n----------------------------------------\n\n";
}
echo wp_kses_post( apply_filters( 'woocommerce_email_footer_text', get_option( 'woocommerce_email_footer_text' ) ) ); // phpcs:ignore WooCommerce.Commenting.CommentHooks.MissingHookComment

View File

@@ -0,0 +1,47 @@
<?php
/**
* Customer Stock Notification template.
*
* This template can be overridden by copying it to yourtheme/woocommerce/emails/plain/customer-stock-notification.php.
*
* HOWEVER, on occasion WooCommerce will need to update template files and you
* (the theme developer) will need to copy the new files to your theme to
* maintain compatibility. We try to do this as little as possible, but it does
* happen. When this occurs the version of the template file will be bumped and
* the readme will list any important changes.
*
* @see https://woocommerce.com/document/template-structure/
* @package WooCommerce\Templates\Emails\Plain
* @version 10.2.0
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n";
echo esc_html( wp_strip_all_tags( $email_heading ) );
echo "\n=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n";
echo esc_html( wp_strip_all_tags( wptexturize( apply_filters( 'woocommerce_email_intro_content', $intro_content, $notification ) ) ) ); // phpcs:ignore WooCommerce.Commenting.CommentHooks.MissingHookComment
echo "\n\n----------------------------------------\n\n";
/**
* Hook: woocommerce_email_stock_notification_product.
*
* @since 10.2.0
*/
do_action( 'woocommerce_email_stock_notification_product', $product, $notification, true, $email );
/**
* Show user-defined additional content - this is set in each email's settings.
*/
if ( $additional_content ) {
echo esc_html( wp_strip_all_tags( wptexturize( $additional_content ) ) );
echo "\n\n----------------------------------------\n\n";
}
echo wp_kses_post( apply_filters( 'woocommerce_email_footer_text', get_option( 'woocommerce_email_footer_text' ) ) ); // phpcs:ignore WooCommerce.Commenting.CommentHooks.MissingHookComment

View File

@@ -0,0 +1,66 @@
<?php
/**
* Email Addresses (plain)
*
* This template can be overridden by copying it to yourtheme/woocommerce/emails/plain/email-addresses.php.
*
* HOWEVER, on occasion WooCommerce will need to update template files and you
* (the theme developer) will need to copy the new files to your theme to
* maintain compatibility. We try to do this as little as possible, but it does
* happen. When this occurs the version of the template file will be bumped and
* the readme will list any important changes.
*
* @see https://woocommerce.com/document/template-structure/
* @package WooCommerce\Templates\Emails\Plain
* @version 8.6.0
*/
defined( 'ABSPATH' ) || exit;
echo "\n" . esc_html( wc_strtoupper( esc_html__( 'Billing address', 'woocommerce' ) ) ) . "\n\n";
echo preg_replace( '#<br\s*/?>#i', "\n", $order->get_formatted_billing_address() ) . "\n"; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
if ( $order->get_billing_phone() ) {
echo $order->get_billing_phone() . "\n"; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
if ( $order->get_billing_email() ) {
echo $order->get_billing_email() . "\n"; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
/**
* Fires after the core address fields in emails.
*
* @since 8.6.0
*
* @param string $type Address type. Either 'billing' or 'shipping'.
* @param WC_Order $order Order instance.
* @param bool $sent_to_admin If this email is being sent to the admin or not.
* @param bool $plain_text If this email is plain text or not.
*/
do_action( 'woocommerce_email_customer_address_section', 'billing', $order, $sent_to_admin, true );
if ( ! wc_ship_to_billing_address_only() && $order->needs_shipping_address() ) {
$shipping = $order->get_formatted_shipping_address();
if ( $shipping ) {
echo "\n" . esc_html( wc_strtoupper( esc_html__( 'Shipping address', 'woocommerce' ) ) ) . "\n\n";
echo preg_replace( '#<br\s*/?>#i', "\n", $shipping ) . "\n"; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
if ( $order->get_shipping_phone() ) {
echo $order->get_shipping_phone() . "\n"; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
/**
* Fires after the core address fields in emails.
*
* @since 8.6.0
*
* @param string $type Address type. Either 'billing' or 'shipping'.
* @param WC_Order $order Order instance.
* @param bool $sent_to_admin If this email is being sent to the admin or not.
* @param bool $plain_text If this email is plain text or not.
*/
do_action( 'woocommerce_email_customer_address_section', 'shipping', $order, $sent_to_admin, true );
}
}

View File

@@ -0,0 +1,26 @@
<?php
/**
* Additional Customer Details (plain)
*
* This is extra customer data which can be filtered by plugins. It outputs below the order item table.
*
* This template can be overridden by copying it to yourtheme/woocommerce/emails/plain/email-customer-details.php.
*
* HOWEVER, on occasion WooCommerce will need to update template files and you
* (the theme developer) will need to copy the new files to your theme to
* maintain compatibility. We try to do this as little as possible, but it does
* happen. When this occurs the version of the template file will be bumped and
* the readme will list any important changes.
*
* @see https://woocommerce.com/document/template-structure/
* @package WooCommerce\Templates\Emails\Plain
* @version 3.4.0
*/
defined( 'ABSPATH' ) || exit;
echo esc_html( wc_strtoupper( esc_html__( 'Customer details', 'woocommerce' ) ) ) . "\n\n";
foreach ( $fields as $field ) {
echo wp_kses_post( $field['label'] ) . ': ' . wp_kses_post( $field['value'] ) . "\n";
}

View File

@@ -0,0 +1,50 @@
<?php
/**
* Email Downloads.
*
* This template can be overridden by copying it to yourtheme/woocommerce/emails/plain/email-downloads.php.
*
* HOWEVER, on occasion WooCommerce will need to update template files and you
* (the theme developer) will need to copy the new files to your theme to
* maintain compatibility. We try to do this as little as possible, but it does
* happen. When this occurs the version of the template file will be bumped and
* the readme will list any important changes.
*
* @see https://woocommerce.com/document/template-structure/
* @package WooCommerce\Templates
* @version 3.4.0
*/
defined( 'ABSPATH' ) || exit;
echo esc_html( wc_strtoupper( esc_html__( 'Downloads', 'woocommerce' ) ) ) . "\n\n";
foreach ( $downloads as $download ) {
foreach ( $columns as $column_id => $column_name ) {
echo wp_kses_post( $column_name ) . ': ';
if ( has_action( 'woocommerce_email_downloads_column_' . $column_id ) ) {
do_action( 'woocommerce_email_downloads_column_' . $column_id, $download, $plain_text );
} else {
switch ( $column_id ) {
case 'download-product':
echo esc_html( $download['product_name'] );
break;
case 'download-file':
echo esc_html( $download['download_name'] ) . ' - ' . esc_url( $download['download_url'] );
break;
case 'download-expires':
if ( ! empty( $download['access_expires'] ) ) {
echo esc_html( date_i18n( get_option( 'date_format' ), strtotime( $download['access_expires'] ) ) );
} else {
esc_html_e( 'Never', 'woocommerce' );
}
break;
}
}
echo "\n";
}
echo "\n";
}
echo '=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=';
echo "\n\n";

View File

@@ -0,0 +1,91 @@
<?php
/**
* Order fulfillment details table shown in emails as plain text.
*
* This template can be overridden by copying it to yourtheme/woocommerce/emails/plain/email-fulfillment-details.php.
*
* HOWEVER, on occasion WooCommerce will need to update template files and you
* (the theme developer) will need to copy the new files to your theme to
* maintain compatibility. We try to do this as little as possible, but it does
* happen. When this occurs the version of the template file will be bumped and
* the readme will list any important changes.
*
* @see https://woocommerce.com/document/template-structure/
* @package WooCommerce\Templates\Emails\Plain
* @version 10.1.0
*/
defined( 'ABSPATH' ) || exit;
if ( null === $fulfillment->get_date_deleted() ) {
$tracking_number = $fulfillment->get_meta( '_tracking_number', true );
$tracking_url = $fulfillment->get_meta( '_tracking_url' );
$shipment_provider = $fulfillment->get_meta( '_shipment_provider' );
if ( ! $tracking_number && ! $tracking_url && ! $shipment_provider ) {
echo esc_html__( 'No tracking information available for this fulfillment at the moment.', 'woocommerce' );
return;
} else {
echo esc_html__( 'Tracking Number', 'woocommerce' ) . ': ' . esc_attr( $tracking_number ) . "\n";
echo esc_html__( 'Shipment Provider', 'woocommerce' ) . ': ' . esc_html( $shipment_provider ) . "\n";
echo esc_html__( 'Tracking URL', 'woocommerce' ) . ': ' . esc_html( $tracking_url ) . "\n\n";
}
echo esc_html__( 'You can access to more details of your order by visiting My Account > Orders and select the order you wish to see the latest status of the delivery.', 'woocommerce' );
echo "\n\n\n";
}
/**
* Action hook to add custom content before fulfillment details in email.
*
* @param WC_Order $order Order object.
* @param Fulfillment $fulfillment Fulfillment object.
* @param bool $sent_to_admin Whether it's sent to admin or customer.
* @param bool $plain_text Whether it's a plain text email.
* @param WC_Email $email Email object.
* @since 2.5.0
*/
do_action( 'woocommerce_email_before_fulfillment_table', $order, $fulfillment, $sent_to_admin, $plain_text, $email );
echo wp_kses_post( __( 'Fulfillment summary', 'woocommerce' ) );
echo "\n\n==========\n\n";
if ( $sent_to_admin ) {
$before = '';
$after = '(' . esc_url( $order->get_edit_order_url() ) . ')';
} else {
$before = '';
$after = '';
}
/* translators: %s: Order ID. */
$order_number_string = __( 'Order #%s', 'woocommerce' );
echo wp_kses_post(
$before . sprintf(
$order_number_string . $after . ' (%s)',
$order->get_order_number(),
wc_format_datetime( $order->get_date_created() )
)
);
echo "\n\n\n";
echo wc_get_email_fulfillment_items( // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
$order,
$fulfillment,
array(
'show_sku' => $sent_to_admin,
'show_image' => true,
'image_size' => array( 48, 48 ),
'plain_text' => $plain_text,
'sent_to_admin' => $sent_to_admin,
)
);
/**
* Action hook to add custom content after fulfillment details in email.
*
* @param WC_Order $order Order object.
* @param bool $sent_to_admin Whether it's sent to admin or customer.
* @param bool $plain_text Whether it's a plain text email.
* @param WC_Email $email Email object.
* @since 2.5.0
*/
do_action( 'woocommerce_email_after_fulfillment_table', $order, $fulfillment, $sent_to_admin, $plain_text, $email );

View File

@@ -0,0 +1,77 @@
<?php
/**
* Email Fulfillment Items (plain)
*
* This template can be overridden by copying it to yourtheme/woocommerce/emails/plain/email-fulfillment-items.php.
*
* HOWEVER, on occasion WooCommerce will need to update template files and you
* (the theme developer) will need to copy the new files to your theme to
* maintain compatibility. We try to do this as little as possible, but it does
* happen. When this occurs the version of the template file will be bumped and
* the readme will list any important changes.
*
* @see https://woocommerce.com/document/template-structure/
* @package WooCommerce\Templates\Emails\Plain
* @version 10.1.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
foreach ( $items as $item_id => $item ) :
/**
* Email Order Item Visibility hook.
*
* @since 2.5.0
* @param $visible Whether the item is visible in the email.
* @param WC_Order_Item_Product $item The order item object.
*
* @return bool
*/
if ( apply_filters(
'woocommerce_order_item_visible',
true,
$item->item
) ) {
$product = $item->item->get_product();
$sku = '';
$purchase_note = '';
if ( is_object( $product ) ) {
$sku = $product->get_sku();
$purchase_note = $product->get_purchase_note();
}
/**
* Email Order Item Name hook.
*
* @since 2.1.0
* @since 2.4.0 Added $is_visible parameter.
* @param string $product_name Product name.
* @param WC_Order_Item $item Order item object.
* @param bool $is_visible Is item visible.
*/
$product_name = apply_filters( 'woocommerce_order_item_name', $item->item->get_name(), $item->item, false );
/**
* Email Order Item Quantity hook.
*
* @since 2.4.0
* @param int $quantity Item quantity.
* @param WC_Order_Item $item Item object.
*/
$product_name .= ' × ' . apply_filters( 'woocommerce_email_order_item_quantity', $item->qty, $item->item );
echo wp_kses_post( str_pad( wp_kses_post( $product_name ), 40 ) );
echo ' ';
echo esc_html( str_pad( wp_kses( $order->get_formatted_line_subtotal( $item->item ), array() ), 20, ' ', STR_PAD_LEFT ) ) . "\n";
// SKU.
if ( $show_sku && $sku ) {
echo esc_html( '(#' . $sku . ")\n" );
}
}
// Note.
if ( $show_purchase_note && $purchase_note ) {
echo "\n" . do_shortcode( wp_kses_post( $purchase_note ) );
}
endforeach;

View File

@@ -0,0 +1,82 @@
<?php
/**
* Order details table shown in emails.
*
* This template can be overridden by copying it to yourtheme/woocommerce/emails/plain/email-order-details.php.
*
* HOWEVER, on occasion WooCommerce will need to update template files and you
* (the theme developer) will need to copy the new files to your theme to
* maintain compatibility. We try to do this as little as possible, but it does
* happen. When this occurs the version of the template file will be bumped and
* the readme will list any important changes.
*
* @see https://woocommerce.com/document/template-structure/
* @package WooCommerce\Templates\Emails
* @version 10.1.0
*/
use Automattic\WooCommerce\Utilities\FeaturesUtil;
defined( 'ABSPATH' ) || exit;
$email_improvements_enabled = FeaturesUtil::feature_is_enabled( 'email_improvements' );
if ( $email_improvements_enabled ) {
add_filter( 'woocommerce_order_shipping_to_display_shipped_via', '__return_false' );
}
do_action( 'woocommerce_email_before_order_table', $order, $sent_to_admin, $plain_text, $email );
if ( $email_improvements_enabled ) {
/* translators: %1$s: Order ID. %2$s: Order date */
echo wp_kses_post( sprintf( esc_html__( 'Order #%1$s (%2$s)', 'woocommerce' ), $order->get_order_number(), wc_format_datetime( $order->get_date_created() ) ) ) . "\n";
echo "\n==========\n";
} else {
/* translators: %1$s: Order ID. %2$s: Order date */
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";
}
echo "\n" . wc_get_email_order_items( // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
$order,
array(
'show_sku' => $sent_to_admin,
'show_image' => false,
'image_size' => array( 32, 32 ),
'plain_text' => true,
'sent_to_admin' => $sent_to_admin,
)
);
echo "==========\n\n";
$item_totals = $order->get_order_item_totals();
if ( $item_totals ) {
foreach ( $item_totals as $total ) {
if ( $email_improvements_enabled ) {
$label = $total['label'];
if ( isset( $total['meta'] ) ) {
$label .= ' ' . $total['meta'];
}
echo wp_kses_post( str_pad( wp_kses_post( $label ), 40 ) );
echo ' ';
echo esc_html( str_pad( wp_kses( $total['value'], array() ), 20, ' ', STR_PAD_LEFT ) ) . "\n";
} else {
echo wp_kses_post( $total['label'] . "\t " . $total['value'] ) . "\n";
}
}
}
if ( $order->get_customer_note() ) {
if ( $email_improvements_enabled ) {
echo "\n" . esc_html__( 'Note:', 'woocommerce' ) . "\n" . wp_kses( wc_wptexturize_order_note( $order->get_customer_note() ), array() ) . "\n";
} else {
echo esc_html__( 'Note:', 'woocommerce' ) . "\t " . wp_kses( wc_wptexturize_order_note( $order->get_customer_note() ), array() ) . "\n";
}
}
if ( $sent_to_admin ) {
/* translators: %s: Order link. */
echo "\n" . sprintf( esc_html__( 'View order: %s', 'woocommerce' ), esc_url( $order->get_edit_order_url() ) ) . "\n";
}
do_action( 'woocommerce_email_after_order_table', $order, $sent_to_admin, $plain_text, $email );

View File

@@ -0,0 +1,113 @@
<?php
/**
* Email Order Items (plain)
*
* This template can be overridden by copying it to yourtheme/woocommerce/emails/plain/email-order-items.php.
*
* HOWEVER, on occasion WooCommerce will need to update template files and you
* (the theme developer) will need to copy the new files to your theme to
* maintain compatibility. We try to do this as little as possible, but it does
* happen. When this occurs the version of the template file will be bumped and
* the readme will list any important changes.
*
* @see https://woocommerce.com/document/template-structure/
* @package WooCommerce\Templates\Emails\Plain
* @version 9.8.0
*/
use Automattic\WooCommerce\Utilities\FeaturesUtil;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
$email_improvements_enabled = FeaturesUtil::feature_is_enabled( 'email_improvements' );
foreach ( $items as $item_id => $item ) :
if ( apply_filters( 'woocommerce_order_item_visible', true, $item ) ) {
$product = $item->get_product();
$sku = '';
$purchase_note = '';
if ( is_object( $product ) ) {
$sku = $product->get_sku();
$purchase_note = $product->get_purchase_note();
}
if ( $email_improvements_enabled ) {
/**
* Email Order Item Name hook.
*
* @since 2.1.0
* @since 2.4.0 Added $is_visible parameter.
* @param string $product_name Product name.
* @param WC_Order_Item $item Order item object.
* @param bool $is_visible Is item visible.
*/
$product_name = apply_filters( 'woocommerce_order_item_name', $item->get_name(), $item, false );
/**
* Email Order Item Quantity hook.
*
* @since 2.4.0
* @param int $quantity Item quantity.
* @param WC_Order_Item $item Item object.
*/
$product_name .= ' × ' . apply_filters( 'woocommerce_email_order_item_quantity', $item->get_quantity(), $item );
echo wp_kses_post( str_pad( wp_kses_post( $product_name ), 40 ) );
echo ' ';
echo esc_html( str_pad( wp_kses( $order->get_formatted_line_subtotal( $item ), array() ), 20, ' ', STR_PAD_LEFT ) ) . "\n";
if ( $show_sku && $sku ) {
echo esc_html( '(#' . $sku . ")\n" );
}
} else {
// phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped
/**
* Email Order Item Name hook.
*
* @since 2.1.0
* @since 2.4.0 Added $is_visible parameter.
* @param string $product_name Product name.
* @param WC_Order_Item $item Order item object.
* @param bool $is_visible Is item visible.
*/
echo wp_kses_post( apply_filters( 'woocommerce_order_item_name', $item->get_name(), $item, false ) );
if ( $show_sku && $sku ) {
echo ' (#' . $sku . ')';
}
/**
* Email Order Item Quantity hook.
*
* @since 2.4.0
* @param int $quantity Item quantity.
* @param WC_Order_Item $item Item object.
*/
echo ' X ' . apply_filters( 'woocommerce_email_order_item_quantity', $item->get_quantity(), $item );
echo ' = ' . $order->get_formatted_line_subtotal( $item ) . "\n";
// phpcs:enable WordPress.Security.EscapeOutput.OutputNotEscaped
}
// allow other plugins to add additional product information here.
do_action( 'woocommerce_order_item_meta_start', $item_id, $item, $order, $plain_text );
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
echo strip_tags(
wc_display_item_meta(
$item,
array(
'before' => "\n- ",
'separator' => "\n- ",
'after' => '',
'echo' => false,
'autop' => false,
)
)
);
// allow other plugins to add additional product information here.
do_action( 'woocommerce_order_item_meta_end', $item_id, $item, $order, $plain_text );
}
// Note.
if ( $show_purchase_note && $purchase_note ) {
echo "\n" . do_shortcode( wp_kses_post( $purchase_note ) );
}
echo "\n\n";
endforeach;