feat: Implement default payment method for pickup and enhance payment method handling in CartTab and PaymentMethodSelector components

This commit is contained in:
sebseb7
2026-03-24 06:51:47 +01:00
parent e6f3fb7c18
commit 1840512aac
3 changed files with 43 additions and 8 deletions

View File

@@ -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(