feat: Implement default payment method for pickup and enhance payment method handling in CartTab and PaymentMethodSelector components
This commit is contained in:
@@ -223,6 +223,15 @@ class CartTab extends Component {
|
||||
handleDeliveryMethodChange = (event) => {
|
||||
const newDeliveryMethod = this.normalizeDeliveryMethod(event.target.value);
|
||||
const deliveryCost = this.orderService.getDeliveryCost();
|
||||
|
||||
// Pickup should default to in-store payment.
|
||||
if (newDeliveryMethod === "Abholung") {
|
||||
this.setState({
|
||||
deliveryMethod: newDeliveryMethod,
|
||||
paymentMethod: "cash",
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
// Get optimal payment method for the new delivery method
|
||||
const optimalPaymentMethod = CheckoutValidation.getOptimalPaymentMethod(
|
||||
|
||||
Reference in New Issue
Block a user