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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user