Commit ddf5d9ecdd2 for woocommerce

commit ddf5d9ecdd2af6bde534688aa6caf63086028a54
Author: Lucio Giannotta <lucio.giannotta@a8c.com>
Date:   Tue May 26 19:43:08 2026 +0800

    Announce order note save to screen readers (#64891)

    Adding an order note from the order admin meta box updated the DOM silently — screen reader users had no confirmation that the note had saved (or, for customer notes, that it had been emailed). Failed WCAG 4.1.3 Status Messages.

    Call wp.a11y.speak() after a successful save with one of two messages depending on note_type, add the corresponding strings to the localized i18n payload, and declare wp-a11y as a dependency of the order meta-boxes script.

    Fixes #64512

diff --git a/plugins/woocommerce/changelog/64891-fix-wooplug-6629-order-notes-a11y b/plugins/woocommerce/changelog/64891-fix-wooplug-6629-order-notes-a11y
new file mode 100644
index 00000000000..9bf297265b3
--- /dev/null
+++ b/plugins/woocommerce/changelog/64891-fix-wooplug-6629-order-notes-a11y
@@ -0,0 +1,4 @@
+Significance: patch
+Type: fix
+
+Announce order note save success to screen readers when adding a note from the order admin meta box, distinguishing between private notes and customer-emailed notes (WCAG 4.1.3).
\ No newline at end of file
diff --git a/plugins/woocommerce/client/legacy/js/admin/meta-boxes-order.js b/plugins/woocommerce/client/legacy/js/admin/meta-boxes-order.js
index 8949cac54b8..b69e8d7af3d 100644
--- a/plugins/woocommerce/client/legacy/js/admin/meta-boxes-order.js
+++ b/plugins/woocommerce/client/legacy/js/admin/meta-boxes-order.js
@@ -1405,6 +1405,17 @@ jQuery( function ( $ ) {
 				$( 'ul.order_notes' ).prepend( response );
 				$( '#woocommerce-order-notes' ).unblock();
 				$( '#add_order_note' ).val( '' );
+
+				// Announce the result to screen readers (WCAG 4.1.3).
+				if ( window.wp && window.wp.a11y && 'function' === typeof window.wp.a11y.speak ) {
+					var message = 'customer' === data.note_type
+						? woocommerce_admin_meta_boxes.i18n_customer_order_note_added
+						: woocommerce_admin_meta_boxes.i18n_order_note_added;
+					if ( message ) {
+						window.wp.a11y.speak( message, 'polite' );
+					}
+				}
+
 				window.wcTracks.recordEvent( 'order_edit_add_order_note', {
 					order_id: woocommerce_admin_meta_boxes.post_id,
 					note_type: data.note_type || 'private',
diff --git a/plugins/woocommerce/includes/admin/class-wc-admin-assets.php b/plugins/woocommerce/includes/admin/class-wc-admin-assets.php
index 2f073be2a89..86349ee7d31 100644
--- a/plugins/woocommerce/includes/admin/class-wc-admin-assets.php
+++ b/plugins/woocommerce/includes/admin/class-wc-admin-assets.php
@@ -595,7 +595,7 @@ if ( ! class_exists( 'WC_Admin_Assets', false ) ) :
 			if ( $this->is_order_meta_box_screen( $screen_id ) ) {
 				$default_location = wc_get_customer_default_location();

-				wp_enqueue_script( 'wc-admin-order-meta-boxes', WC()->plugin_url() . '/assets/js/admin/meta-boxes-order' . $suffix . '.js', array( 'wc-admin-meta-boxes', 'wc-backbone-modal', 'selectWoo', 'wc-clipboard' ), $version );
+				wp_enqueue_script( 'wc-admin-order-meta-boxes', WC()->plugin_url() . '/assets/js/admin/meta-boxes-order' . $suffix . '.js', array( 'wc-admin-meta-boxes', 'wc-backbone-modal', 'selectWoo', 'wc-clipboard', 'wp-a11y' ), $version );
 				wp_localize_script(
 					'wc-admin-order-meta-boxes',
 					'woocommerce_admin_meta_boxes_order',
@@ -704,6 +704,8 @@ if ( ! class_exists( 'WC_Admin_Assets', false ) ) :
 					'i18n_delete_note'                                => __( 'Are you sure you wish to delete this note? This action cannot be undone.', 'woocommerce' ),
 					'i18n_delete_customer_note'                       => __( 'Are you sure you wish to delete this note? This action cannot be undone. Caution: This only removes the note from your records — it does not recall the email already sent to the customer.', 'woocommerce' ),
 					'i18n_no_notes_yet'                               => __( 'There are no notes yet.', 'woocommerce' ),
+					'i18n_order_note_added'                           => __( 'Order note added.', 'woocommerce' ),
+					'i18n_customer_order_note_added'                  => __( 'Order note added and emailed to the customer.', 'woocommerce' ),
 					'i18n_apply_coupon'                               => __( 'Enter a coupon code to apply. Discounts are applied to line totals, before taxes.', 'woocommerce' ),
 					'i18n_add_fee'                                    => __( 'Enter a fixed amount or percentage to apply as a fee.', 'woocommerce' ),
 					'i18n_attribute_name_placeholder'                 => __( 'New attribute', 'woocommerce' ),