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 <mike.jolley@me.com>
This commit is contained in:
Paulo Arromba 2024-08-12 16:34:09 +01:00 committed by GitHub
parent f7595c6725
commit ddbb24e021
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 17 additions and 3 deletions

View File

@ -0,0 +1,4 @@
Significance: patch
Type: fix
Resolved an issue that caused the page title and content text to display in the incorrect order on the Order Confirmation page.

View File

@ -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(
'<div class="wc-block-order-confirmation-status-notices %1$s">%2$s</div>',
esc_attr( trim( $classname ) ),
$account_notice
) . $block;
}
$additional_content = $this->render_confirmation_notice( $order );
if ( $additional_content ) {
return sprintf(
$block = $block . sprintf(
'<div class="wc-block-order-confirmation-status-description %1$s">%2$s</div>',
esc_attr( trim( $classname ) ),
$additional_content
) . $block;
);
}
return $block;