From 8bd10b29eaf43cade31acc5a7ecb5a0a695cd1dd Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 13 Aug 2024 09:59:29 -0700 Subject: [PATCH] Cherry pick 50592 into release/9.2 (#50602) * Fixed the order of elements on the Order Confirmation screen (#50592) * Fixed the order of elements on the Order Confirmation screen * Added changelog * Linting. * Add wrapper around account notices --------- Co-authored-by: Mike Jolley * Prep for cherry pick 50592 --------- Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com> Co-authored-by: Mike Jolley Co-authored-by: WooCommerce Bot --- plugins/woocommerce/readme.txt | 1 + .../BlockTypes/OrderConfirmation/Status.php | 16 +++++++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/plugins/woocommerce/readme.txt b/plugins/woocommerce/readme.txt index 4250e19767c..294d8ed4c0d 100644 --- a/plugins/woocommerce/readme.txt +++ b/plugins/woocommerce/readme.txt @@ -173,6 +173,7 @@ WooCommerce comes with some sample data you can use to see how products look; im **WooCommerce** +* Fix - Resolved an issue that caused the page title and content text to display in the incorrect order on the Order Confirmation page. [#50592](https://github.com/woocommerce/woocommerce/pull/50592) * Fix - Customer Account - Maintain the size of the icon in smaller screens. [#50410](https://github.com/woocommerce/woocommerce/pull/50410) * Fix - Accessibility: Prevent shipping losing focus when making selections during checkout. [#48370](https://github.com/woocommerce/woocommerce/pull/48370) * Fix - Add aria-label to mini-cart button on first render to improve accessibility [#48329](https://github.com/woocommerce/woocommerce/pull/48329) diff --git a/plugins/woocommerce/src/Blocks/BlockTypes/OrderConfirmation/Status.php b/plugins/woocommerce/src/Blocks/BlockTypes/OrderConfirmation/Status.php index 537ce904163..6cc50f68d3a 100644 --- a/plugins/woocommerce/src/Blocks/BlockTypes/OrderConfirmation/Status.php +++ b/plugins/woocommerce/src/Blocks/BlockTypes/OrderConfirmation/Status.php @@ -40,14 +40,24 @@ class Status extends AbstractOrderConfirmationBlock { return ''; } - $additional_content = $this->render_account_notice( $order ) . $this->render_confirmation_notice( $order ); + $account_notice = $this->render_account_notice( $order ); + + if ( $account_notice ) { + $block = sprintf( + '
%2$s
', + esc_attr( trim( $classname ) ), + $account_notice + ) . $block; + } + + $additional_content = $this->render_confirmation_notice( $order ); if ( $additional_content ) { - return sprintf( + $block = $block . sprintf( '
%2$s
', esc_attr( trim( $classname ) ), $additional_content - ) . $block; + ); } return $block;