From db95e435c2ecd4586845278eef3f5849f30b7c22 Mon Sep 17 00:00:00 2001 From: DanielS Date: Thu, 9 Jul 2026 23:43:16 +0200 Subject: [PATCH] fix: auto add configured device to basket on step 3 transition --- shop/components/order-wizard.tsx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/shop/components/order-wizard.tsx b/shop/components/order-wizard.tsx index 45f36b8..062dce1 100644 --- a/shop/components/order-wizard.tsx +++ b/shop/components/order-wizard.tsx @@ -501,7 +501,15 @@ export function OrderWizard({ }) } - const nextStep = () => setStep(s => s + 1) + const nextStep = () => { + if (step === 3 && allCategoriesFilled && productValidationErrors.length === 0) { + const hasProduct = Object.values(selections).some(sel => sel.productId || (sel.productIds && sel.productIds.length > 0)) + if (hasProduct) { + addToBasket() + } + } + setStep(s => s + 1) + } const prevStep = () => setStep(s => s - 1) // Abrechnungsmodell wechseln (und Selektionen der Kategorien anpassen)