Add notices to the error response

This commit is contained in:
Thomas Roberts 2024-04-10 15:53:25 +01:00
parent 0387404d7f
commit 571a55de28
No known key found for this signature in database
GPG Key ID: 0262BEBCBE336365
1 changed files with 3 additions and 0 deletions

View File

@ -290,6 +290,9 @@ class Checkout extends AbstractCartRoute {
if ( 409 === $http_status_code ) {
return $this->add_data_to_error_object( $error_from_message, $additional_data, $http_status_code, true );
}
$additional_data['notices'] = wc_get_notices();
wc_clear_notices();
return $this->add_data_to_error_object( $error_from_message, $additional_data, $http_status_code );
}