Update PaymentSuccess component to set redirect hash based on payment status: '#orders' for successful payments and '#cart' for failed payments.

This commit is contained in:
sebseb7
2025-07-16 13:47:16 +02:00
parent 4ef27da561
commit 1de3ba0115

View File

@@ -108,8 +108,8 @@ class PaymentSuccess extends Component {
profileUrl.searchParams.set('mollie_order_id', response.order.orderId.toString());
}
// Set hash to cart tab
profileUrl.hash = '#cart';
// Set hash based on payment success: orders for successful payments, cart for failed payments
profileUrl.hash = response.payment.isPaid ? '#orders' : '#cart';
this.setState({
redirectUrl: profileUrl.pathname + profileUrl.search + profileUrl.hash,