Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Update wording on checkout error message to try to prevent retries #10888

Merged
merged 3 commits into from
Oct 10, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ const CheckoutProcessor = () => {
orderNotes,
shouldCreateAccount,
extensionData,
customerId,
} = useSelect( ( select ) => {
const store = select( CHECKOUT_STORE_KEY );
return {
Expand All @@ -69,6 +70,7 @@ const CheckoutProcessor = () => {
orderNotes: store.getOrderNotes(),
shouldCreateAccount: store.getShouldCreateAccount(),
extensionData: store.getExtensionData(),
customerId: store.getCustomerId(),
};
} );

Expand Down Expand Up @@ -293,12 +295,20 @@ const CheckoutProcessor = () => {
__internalProcessCheckoutResponse( response );
} );
} catch {
let errorMessage = __(
'Something went wrong when placing the order. Check your email for order updates before retrying.',
'woo-gutenberg-products-block'
);

if ( customerId !== 0 ) {
errorMessage = __(
"Something went wrong when placing the order. Check your account's order history or your email for order updates before retrying.",
'woo-gutenberg-products-block'
);
}
processErrorResponse( {
code: 'unknown_error',
message: __(
'Something went wrong. Please try placing your order again.',
'woo-gutenberg-products-block'
),
message: errorMessage,
data: null,
} );
}
Expand Down