From 73e046e9592e03a1d9bd452a9256d0e657d778f1 Mon Sep 17 00:00:00 2001 From: DanielS Date: Tue, 11 Aug 2026 00:28:13 +0200 Subject: [PATCH] style: limit step 3 sidebar scroll to basket items --- shop/components/order-wizard.tsx | 2 +- shop/components/wizard/summary-sidebar.tsx | 258 +++++++++++---------- 2 files changed, 133 insertions(+), 127 deletions(-) diff --git a/shop/components/order-wizard.tsx b/shop/components/order-wizard.tsx index 8953906..ed79ad2 100644 --- a/shop/components/order-wizard.tsx +++ b/shop/components/order-wizard.tsx @@ -1064,7 +1064,7 @@ export function OrderWizard({ -
+
- +
+ Zusammenfassung - - {visibleCategories.map(cat => { - const sel = selections[cat.id] - const selectedProds: Product[] = [] - if (cat.allow_multiselect && sel?.productIds) { - sel.productIds.forEach(pId => { - const p = products.find(prod => prod.id === pId) + + + {/* Active Selections & Price Calculation (Fixed) */} +
+ {visibleCategories.map(cat => { + const sel = selections[cat.id] + const selectedProds: Product[] = [] + if (cat.allow_multiselect && sel?.productIds) { + sel.productIds.forEach(pId => { + const p = products.find(prod => prod.id === pId) + if (p) selectedProds.push(p) + }) + } else if (sel?.productId) { + const p = products.find(prod => prod.id === sel.productId) if (p) selectedProds.push(p) - }) - } else if (sel?.productId) { - const p = products.find(prod => prod.id === sel.productId) - if (p) selectedProds.push(p) - } + } - if (selectedProds.length === 0) return ( -
- {cat.is_required ? ( - - ) : ( - - )} - {cat.name}: {cat.is_required ? 'nicht gewählt' : 'nicht gewählt (optional)'} -
- ) - - const sortedProds = [...selectedProds].sort((a, b) => a.base_price - b.base_price) - const freeLimit = cat.allow_multiselect ? cat.free_items_limit : 0 - - return ( -
-
- {cat.name} + if (selectedProds.length === 0) return ( +
+ {cat.is_required ? ( + + ) : ( + + )} + {cat.name}: {cat.is_required ? 'nicht gewählt' : 'nicht gewählt (optional)'}
- {sortedProds.map((prod, idx) => { - const isFree = idx < freeLimit - const actualPrice = isFree ? 0 : prod.base_price - return ( -
-
- {prod.name} {isFree && (Frei)} - - {new Intl.NumberFormat('de-DE', { style: 'currency', currency: 'EUR' }).format(actualPrice)} - {' '}{billingLabel(prod.billing_interval)} - + ) + + const sortedProds = [...selectedProds].sort((a, b) => a.base_price - b.base_price) + const freeLimit = cat.allow_multiselect ? cat.free_items_limit : 0 + + return ( +
+
+ {cat.name} +
+ {sortedProds.map((prod, idx) => { + const isFree = idx < freeLimit + const actualPrice = isFree ? 0 : prod.base_price + return ( +
+
+ {prod.name} {isFree && (Frei)} + + {new Intl.NumberFormat('de-DE', { style: 'currency', currency: 'EUR' }).format(actualPrice)} + {' '}{billingLabel(prod.billing_interval)} + +
+ {sel.moduleIds.map(mId => { + const mod = prod.modules?.find(m => m.id === mId) + const qty = moduleQuantities[mId] || 1 + return mod ? ( +
+ + {mod.name} {mod.has_quantity ? `(x${qty})` : ''} + + {new Intl.NumberFormat('de-DE', { style: 'currency', currency: 'EUR' }).format(mod.price * qty)} + +
+ ) : null + })}
- {sel.moduleIds.map(mId => { - const mod = prod.modules?.find(m => m.id === mId) - const qty = moduleQuantities[mId] || 1 - return mod ? ( -
- + {mod.name} {mod.has_quantity ? `(x${qty})` : ''} - - {new Intl.NumberFormat('de-DE', { style: 'currency', currency: 'EUR' }).format(mod.price * qty)} - -
- ) : null - })} -
- ) - })} + ) + })} +
+ ) + })} + + {oneTimeTotal > 0 && monthlyTotal > 0 ? ( +
+
+

Einmalig:

+
+ Netto: + {new Intl.NumberFormat('de-DE', { style: 'currency', currency: 'EUR' }).format(oneTimeNet)} +
+
+ zzgl. 19% MwSt.: + {new Intl.NumberFormat('de-DE', { style: 'currency', currency: 'EUR' }).format(oneTimeTax)} +
+
+ Gesamt (brutto): + {new Intl.NumberFormat('de-DE', { style: 'currency', currency: 'EUR' }).format(oneTimeGross)} +
+
+
+

Monatlich:

+
+ Netto: + {new Intl.NumberFormat('de-DE', { style: 'currency', currency: 'EUR' }).format(monthlyNet)} / mtl. +
+
+ zzgl. 19% MwSt.: + {new Intl.NumberFormat('de-DE', { style: 'currency', currency: 'EUR' }).format(monthlyTax)} / mtl. +
+
+ Gesamt (brutto): + {new Intl.NumberFormat('de-DE', { style: 'currency', currency: 'EUR' }).format(monthlyGross)} / mtl. +
+
- ) - })} - - {oneTimeTotal > 0 && monthlyTotal > 0 ? ( -
+ ) : oneTimeTotal > 0 ? (
-

Einmalig:

- Netto: + Netto-Gesamtbetrag: {new Intl.NumberFormat('de-DE', { style: 'currency', currency: 'EUR' }).format(oneTimeNet)}
zzgl. 19% MwSt.: {new Intl.NumberFormat('de-DE', { style: 'currency', currency: 'EUR' }).format(oneTimeTax)}
-
- Gesamt (brutto): +
+ Gesamtbetrag (brutto): {new Intl.NumberFormat('de-DE', { style: 'currency', currency: 'EUR' }).format(oneTimeGross)}
-
-

Monatlich:

+ ) : ( +
- Netto: + Netto-Gesamtbetrag: {new Intl.NumberFormat('de-DE', { style: 'currency', currency: 'EUR' }).format(monthlyNet)} / mtl.
zzgl. 19% MwSt.: {new Intl.NumberFormat('de-DE', { style: 'currency', currency: 'EUR' }).format(monthlyTax)} / mtl.
-
- Gesamt (brutto): +
+ Gesamtbetrag (brutto): {new Intl.NumberFormat('de-DE', { style: 'currency', currency: 'EUR' }).format(monthlyGross)} / mtl.
-
- ) : oneTimeTotal > 0 ? ( -
-
- Netto-Gesamtbetrag: - {new Intl.NumberFormat('de-DE', { style: 'currency', currency: 'EUR' }).format(oneTimeNet)} + )} + {updatePriceModifier.label && ( +
+

+ + Update-Rabatt aktiv +

+

{updatePriceModifier.label}

-
- zzgl. 19% MwSt.: - {new Intl.NumberFormat('de-DE', { style: 'currency', currency: 'EUR' }).format(oneTimeTax)} -
-
- Gesamtbetrag (brutto): - {new Intl.NumberFormat('de-DE', { style: 'currency', currency: 'EUR' }).format(oneTimeGross)} -
-
- ) : ( -
-
- Netto-Gesamtbetrag: - {new Intl.NumberFormat('de-DE', { style: 'currency', currency: 'EUR' }).format(monthlyNet)} / mtl. -
-
- zzgl. 19% MwSt.: - {new Intl.NumberFormat('de-DE', { style: 'currency', currency: 'EUR' }).format(monthlyTax)} / mtl. -
-
- Gesamtbetrag (brutto): - {new Intl.NumberFormat('de-DE', { style: 'currency', currency: 'EUR' }).format(monthlyGross)} / mtl. -
-
- )} - {updatePriceModifier.label && ( -
-

- - Update-Rabatt aktiv + )} + {!allCategoriesFilled && ( +

+ + Bitte aus jeder Pflichtkategorie einen Artikel wählen.

-

{updatePriceModifier.label}

-
- )} - {!allCategoriesFilled && ( -

- - Bitte aus jeder Pflichtkategorie einen Artikel wählen. -

- )} - {productValidationErrors.map((err, errIdx) => ( -

- - {err} -

- ))} + )} + {productValidationErrors.map((err, errIdx) => ( +

+ + {err} +

+ ))} +
+ + {/* Warenkorb List (Scrollable) */} {basketItems.length > 0 && ( -
-

Warenkorb ({basketItems.length}):

-
+
+

Warenkorb ({basketItems.length}):

+
{basketItems.map((item, idx) => (