From db2e95b4ce456c618d406d0d8946cd8445b8a9d3 Mon Sep 17 00:00:00 2001 From: barryhughes <3594411+barryhughes@users.noreply.github.com> Date: Thu, 7 Mar 2024 07:44:00 -0800 Subject: [PATCH 1/6] Switch from "invoice" to "order details" in our emails. --- .../fix-26692-order-invoice-nomenclature | 4 ++++ .../class-wc-meta-box-order-actions.php | 2 +- .../class-wc-email-customer-invoice.php | 22 +++++++------------ .../tests/merchant/order-emails.spec.js | 2 +- 4 files changed, 14 insertions(+), 16 deletions(-) create mode 100644 plugins/woocommerce/changelog/fix-26692-order-invoice-nomenclature diff --git a/plugins/woocommerce/changelog/fix-26692-order-invoice-nomenclature b/plugins/woocommerce/changelog/fix-26692-order-invoice-nomenclature new file mode 100644 index 000000000000..9659c36ac2d8 --- /dev/null +++ b/plugins/woocommerce/changelog/fix-26692-order-invoice-nomenclature @@ -0,0 +1,4 @@ +Significance: patch +Type: tweak + +Prefer the use of 'order details' (instead of 'invoice') in our order emails. diff --git a/plugins/woocommerce/includes/admin/meta-boxes/class-wc-meta-box-order-actions.php b/plugins/woocommerce/includes/admin/meta-boxes/class-wc-meta-box-order-actions.php index 622dcc29a84e..8dcb52478051 100644 --- a/plugins/woocommerce/includes/admin/meta-boxes/class-wc-meta-box-order-actions.php +++ b/plugins/woocommerce/includes/admin/meta-boxes/class-wc-meta-box-order-actions.php @@ -199,7 +199,7 @@ public static function set_email_sent_message( $location ) { */ private static function get_available_order_actions_for_order( $order ) { $actions = array( - 'send_order_details' => __( 'Email invoice / order details to customer', 'woocommerce' ), + 'send_order_details' => __( 'Send order details to customer', 'woocommerce' ), 'send_order_details_admin' => __( 'Resend new order notification', 'woocommerce' ), 'regenerate_download_permissions' => __( 'Regenerate download permissions', 'woocommerce' ), ); diff --git a/plugins/woocommerce/includes/emails/class-wc-email-customer-invoice.php b/plugins/woocommerce/includes/emails/class-wc-email-customer-invoice.php index 0a2592cacf53..e3ae6e4e6244 100644 --- a/plugins/woocommerce/includes/emails/class-wc-email-customer-invoice.php +++ b/plugins/woocommerce/includes/emails/class-wc-email-customer-invoice.php @@ -12,9 +12,11 @@ if ( ! class_exists( 'WC_Email_Customer_Invoice', false ) ) : /** - * Customer Invoice. + * OOrder details email. * - * An email sent to the customer via admin. + * An email sent to the customer via admin, that summarizes the details of their order. This was + * historically referred to as the 'invoice', and for backwards compatibility reasons that is still + * reflected in the class name (although on a user-level we have moved away from that nomenclature). * * @class WC_Email_Customer_Invoice * @version 3.5.0 @@ -29,8 +31,8 @@ class WC_Email_Customer_Invoice extends WC_Email { public function __construct() { $this->id = 'customer_invoice'; $this->customer_email = true; - $this->title = __( 'Customer invoice / Order details', 'woocommerce' ); - $this->description = __( 'Customer invoice emails can be sent to customers containing their order information and payment links.', 'woocommerce' ); + $this->title = __( 'Order details', 'woocommerce' ); + $this->description = __( 'Order detail emails can be sent to customers containing their order information and payment links.', 'woocommerce' ); $this->template_html = 'emails/customer-invoice.php'; $this->template_plain = 'emails/plain/customer-invoice.php'; $this->placeholders = array( @@ -52,11 +54,7 @@ public function __construct() { * @return string */ public function get_default_subject( $paid = false ) { - if ( $paid ) { - return __( 'Invoice for order #{order_number} on {site_title}', 'woocommerce' ); - } else { - return __( 'Your latest {site_title} invoice', 'woocommerce' ); - } + return __( 'Order #{order_number} from {site_title}', 'woocommerce' ); } /** @@ -67,11 +65,7 @@ public function get_default_subject( $paid = false ) { * @return string */ public function get_default_heading( $paid = false ) { - if ( $paid ) { - return __( 'Invoice for order #{order_number}', 'woocommerce' ); - } else { - return __( 'Your invoice for order #{order_number}', 'woocommerce' ); - } + return __( 'Order #{order_number}', 'woocommerce' ); } /** diff --git a/plugins/woocommerce/tests/e2e-pw/tests/merchant/order-emails.spec.js b/plugins/woocommerce/tests/e2e-pw/tests/merchant/order-emails.spec.js index 87b9840ce289..cedf75e9d59e 100644 --- a/plugins/woocommerce/tests/e2e-pw/tests/merchant/order-emails.spec.js +++ b/plugins/woocommerce/tests/e2e-pw/tests/merchant/order-emails.spec.js @@ -237,7 +237,7 @@ test.describe( 'Merchant > Order Action emails received', () => { .getByRole( 'row' ) .filter( { hasText: customerBilling.email } ) .filter( { - hasText: `Invoice for order #${ orderId } on ${ storeName }`, + hasText: `Order #${ orderId } from ${ storeName }`, } ) ).toBeVisible(); } ); From f26147c24ad1be31b314c9d47d84a4ca9d78e838 Mon Sep 17 00:00:00 2001 From: Barry Hughes <3594411+barryhughes@users.noreply.github.com> Date: Thu, 7 Mar 2024 10:16:53 -0800 Subject: [PATCH 2/6] Revise default order details email subject text. --- .../includes/emails/class-wc-email-customer-invoice.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/woocommerce/includes/emails/class-wc-email-customer-invoice.php b/plugins/woocommerce/includes/emails/class-wc-email-customer-invoice.php index e3ae6e4e6244..4508f9dbc638 100644 --- a/plugins/woocommerce/includes/emails/class-wc-email-customer-invoice.php +++ b/plugins/woocommerce/includes/emails/class-wc-email-customer-invoice.php @@ -54,7 +54,7 @@ public function __construct() { * @return string */ public function get_default_subject( $paid = false ) { - return __( 'Order #{order_number} from {site_title}', 'woocommerce' ); + return __( 'Details for order #{order_number} on {site_title}', 'woocommerce' ); } /** From 84a0d95d1becea0b88a2e93eb216eae0bc9f611a Mon Sep 17 00:00:00 2001 From: Barry Hughes <3594411+barryhughes@users.noreply.github.com> Date: Thu, 7 Mar 2024 10:17:36 -0800 Subject: [PATCH 3/6] Revise default order details header text. --- .../includes/emails/class-wc-email-customer-invoice.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/woocommerce/includes/emails/class-wc-email-customer-invoice.php b/plugins/woocommerce/includes/emails/class-wc-email-customer-invoice.php index 4508f9dbc638..ef723d8d8be8 100644 --- a/plugins/woocommerce/includes/emails/class-wc-email-customer-invoice.php +++ b/plugins/woocommerce/includes/emails/class-wc-email-customer-invoice.php @@ -65,7 +65,7 @@ public function get_default_subject( $paid = false ) { * @return string */ public function get_default_heading( $paid = false ) { - return __( 'Order #{order_number}', 'woocommerce' ); + return __( 'Details for order #{order_number}', 'woocommerce' ); } /** From 1d42f724a48d5700d7ad06950aa4bd4c645e585b Mon Sep 17 00:00:00 2001 From: Barry Hughes <3594411+barryhughes@users.noreply.github.com> Date: Thu, 7 Mar 2024 10:18:28 -0800 Subject: [PATCH 4/6] Bring E2E check up-to-date with latest text revision. --- .../tests/e2e-pw/tests/merchant/order-emails.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/woocommerce/tests/e2e-pw/tests/merchant/order-emails.spec.js b/plugins/woocommerce/tests/e2e-pw/tests/merchant/order-emails.spec.js index cedf75e9d59e..c7863f40d3cb 100644 --- a/plugins/woocommerce/tests/e2e-pw/tests/merchant/order-emails.spec.js +++ b/plugins/woocommerce/tests/e2e-pw/tests/merchant/order-emails.spec.js @@ -237,7 +237,7 @@ test.describe( 'Merchant > Order Action emails received', () => { .getByRole( 'row' ) .filter( { hasText: customerBilling.email } ) .filter( { - hasText: `Order #${ orderId } from ${ storeName }`, + hasText: `Details for order #${ orderId } on ${ storeName }`, } ) ).toBeVisible(); } ); From a061a77a68e1f1a5446bc42ff2f00683d27bae89 Mon Sep 17 00:00:00 2001 From: barryhughes <3594411+barryhughes@users.noreply.github.com> Date: Thu, 7 Mar 2024 11:11:46 -0800 Subject: [PATCH 5/6] Update API tests to match order detail email changes. --- .../tests/api-core-tests/tests/settings/settings-crud.test.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/woocommerce/tests/api-core-tests/tests/settings/settings-crud.test.js b/plugins/woocommerce/tests/api-core-tests/tests/settings/settings-crud.test.js index f24cb5f3e16d..c137434fa573 100644 --- a/plugins/woocommerce/tests/api-core-tests/tests/settings/settings-crud.test.js +++ b/plugins/woocommerce/tests/api-core-tests/tests/settings/settings-crud.test.js @@ -225,9 +225,9 @@ test.describe.serial( 'Settings API tests: CRUD', () => { expect.arrayContaining( [ expect.objectContaining( { id: 'email_customer_invoice', - label: 'Customer invoice / Order details', + label: 'Order details', description: - 'Customer invoice emails can be sent to customers containing their order information and payment links.', + 'Order detail emails can be sent to customers containing their order information and payment links.', parent_id: 'email', sub_groups: expect.arrayContaining( [] ), } ), From f608530dd47fc495f322d505a1a6d6fac0092eef Mon Sep 17 00:00:00 2001 From: Jorge Torres Date: Wed, 13 Mar 2024 16:11:45 -0300 Subject: [PATCH 6/6] Fix typo --- .../includes/emails/class-wc-email-customer-invoice.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/woocommerce/includes/emails/class-wc-email-customer-invoice.php b/plugins/woocommerce/includes/emails/class-wc-email-customer-invoice.php index ef723d8d8be8..bd6c7b9f05de 100644 --- a/plugins/woocommerce/includes/emails/class-wc-email-customer-invoice.php +++ b/plugins/woocommerce/includes/emails/class-wc-email-customer-invoice.php @@ -12,7 +12,7 @@ if ( ! class_exists( 'WC_Email_Customer_Invoice', false ) ) : /** - * OOrder details email. + * Order details email. * * An email sent to the customer via admin, that summarizes the details of their order. This was * historically referred to as the 'invoice', and for backwards compatibility reasons that is still