diff --git a/app/cart/components/CartContent.tsx b/app/cart/components/CartContent.tsx index 5aedc35..b32dcc8 100644 --- a/app/cart/components/CartContent.tsx +++ b/app/cart/components/CartContent.tsx @@ -9,12 +9,13 @@ import { formatPrice, discountPercent } from "../../lib/format"; import { Reveal } from "../../components/Reveal"; import { VersandModal } from "../../components/VersandModal"; import { FreeShippingBanner } from "./FreeShippingBanner"; -import type { TrustBadge } from "../../lib/payload"; +import type { TrustBadge, ShippingSettings } from "../../lib/payload"; export function CartContent({ trustBadges, shippingCost, freeShippingThreshold, + shippingSettings, }: { trustBadges: TrustBadge[]; /** Price of the default (first active, i.e. Standard) ShippingMethod — an @@ -24,6 +25,12 @@ export function CartContent({ /** Lowest freeShippingThreshold among active ShippingMethods, or null if * none has one (in which case FreeShippingBanner just doesn't render). */ freeShippingThreshold: number | null; + /** Delivery-time disclosure (Payload's Shipping Settings), fetched by the + * page and threaded down here — this is a Client Component, so it can't + * fetch it itself. Also passed straight through to VersandModal. Named + * "shippingSettings", not "shipping" — that name is already the local + * computed shipping-cost value below. */ + shippingSettings: ShippingSettings; }) { const [versandOpen, setVersandOpen] = useState(false); const cart = useCart(); @@ -222,6 +229,9 @@ export function CartContent({ ? `ab ${formatPrice(freeShippingThreshold)} innerhalb Deutschlands` : "innerhalb Deutschlands"}
++ Lieferzeit {shippingSettings.totalDays.min}–{shippingSettings.totalDays.max} Werktage +
@@ -247,9 +257,13 @@ export function CartContent({ Zur Kasse gehen -{selectedShipping?.description ?? "innerhalb Deutschlands"}
++ {shipping === 0 && selectedShipping?.freeShippingThreshold != null + ? `ab ${formatPrice(selectedShipping.freeShippingThreshold)} innerhalb Deutschlands` + : (selectedShipping?.description ?? "innerhalb Deutschlands")} +
++ Lieferzeit {shippingSettings.totalDays.min}–{shippingSettings.totalDays.max} Werktage +
{product.spotlightText || product.description}
-{formatPrice(product.compareAtPrice!)}
- )} -{formatPrice(product.price)}
-inkl. MwSt. zzgl. Versand
+{formatPrice(product.compareAtPrice!)}
+ )} +{formatPrice(product.price)}
+inkl. MwSt. zzgl. Versand
++ Lieferzeit: {shipping.totalDays.min}–{shipping.totalDays.max} Werktage innerhalb Deutschlands +
- {discount !== null && ( - {formatPrice(product.compareAtPrice!)} - )} - {formatPrice(product.price)} - inkl. MwSt. -
++ {discount !== null && ( + {formatPrice(product.compareAtPrice!)} + )} + {formatPrice(product.price)} + inkl. MwSt. +
++ Lieferzeit: {shipping.totalDays.min}–{shipping.totalDays.max} Werktage innerhalb Deutschlands +
+{formatPrice(product.compareAtPrice!)}
- )} -{formatPrice(product.price)}
-inkl. MwSt. zzgl. Versand
+{formatPrice(product.compareAtPrice!)}
+ )} +{formatPrice(product.price)}
+inkl. MwSt. zzgl. Versand
++ Lieferzeit: {shipping.totalDays.min}–{shipping.totalDays.max} Werktage innerhalb Deutschlands +
- Lieferzeit: {TOTAL_DAYS_DE.min}–{TOTAL_DAYS_DE.max} Werktage innerhalb Deutschlands -
+ {/* No "Sichere Zahlung" trust note here (unlike Cart/Checkout) — + this is an add-to-cart step, not the actual payment step, so + a payment-security reassurance is premature here and just + duplicates the one shown later at checkout. */}{formatPrice(product.compareAtPrice!)}
- )} -{formatPrice(product.price)}
-inkl. MwSt.
-{formatPrice(product.compareAtPrice!)}
+ )} +{formatPrice(product.price)}
+inkl. MwSt.
++ Lieferzeit: {shipping.totalDays.min}–{shipping.totalDays.max} Werktage innerhalb Deutschlands +
+Nach Zahlungseingang bereiten wir deine Bestellung in der Regel innerhalb von{" "} - {HANDLING_DAYS.min}–{HANDLING_DAYS.max} Werktagen zum Versand vor. Die Versanddauer - innerhalb Deutschlands beträgt anschließend zusätzlich {TRANSIT_DAYS_DE.min}– - {TRANSIT_DAYS_DE.max} Werktage. + {shipping.handlingDays.min}–{shipping.handlingDays.max} Werktagen zum Versand vor. Die + Versanddauer innerhalb Deutschlands beträgt anschließend zusätzlich{" "} + {shipping.transitDays.min}–{shipping.transitDays.max} Werktage.
- Damit ist deine Bestellung in der Regel nach {TOTAL_DAYS_DE.min}–{TOTAL_DAYS_DE.max}{" "} - Werktagen bei dir, sofern auf der jeweiligen Produktseite nichts anderes angegeben ist. - Als Werktage gelten Montag bis Freitag, ausgenommen gesetzliche Feiertage. + Damit ist deine Bestellung in der Regel nach {shipping.totalDays.min}– + {shipping.totalDays.max} Werktagen bei dir, sofern auf der jeweiligen Produktseite nichts + anderes angegeben ist. Als Werktage gelten Montag bis Freitag, ausgenommen gesetzliche + Feiertage.