diff --git a/src/components/PaymentSuccess.js b/src/components/PaymentSuccess.js index 1f76978..c9899d5 100644 --- a/src/components/PaymentSuccess.js +++ b/src/components/PaymentSuccess.js @@ -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,