feat(shipping): move delivery-time settings to Payload, polish product/cart CTAs
The delivery-time range (handling + transit days) was a hardcoded HANDLING_DAYS/TRANSIT_DAYS_DE pair in lib/shipping.ts — changing it needed a code deploy. Now sourced from Payload's new Shipping Settings collection via getShippingSettings(), threaded down as a prop to the few Client Components (Cart/Checkout/VersandModal) that can't fetch it themselves, with the old code constants removed. Also: the delivery-time note is now shown on every purchase CTA (shop grid, home spotlight, ToDo-Karten hero + pricing panel), not just one of them — required next to each buy button per Art. 246a §1 Abs.1 Nr.8 EGBGB, not just somewhere reachable via a link. Checkout's sidebar was missing the "ab 39€ kostenlos" note Cart already had; that's fixed too, and both now show the delivery-time range on its own line instead of crammed onto the shipping-cost line. Related smaller fixes bundled in since they touch the same files: price/delivery-time spacing tightened into its own group, the redundant "Sichere Zahlung" note under Cart's checkout button (already shown via the trustBadges list right below) replaced with "Sichere SSL-Verschlüsselung" to match Checkout, and ToDo-Karten's pricing panel no longer shows a premature payment-security note at the add-to-cart step.
This commit is contained in:
+12
-15
@@ -1,17 +1,14 @@
|
||||
// Single source of truth for shipping numbers/timeframes — consumed by
|
||||
// both the cart's order summary (CartContent.tsx) and the /versand policy
|
||||
// page, so the two can never drift apart.
|
||||
// Single source of truth for shipping numbers — consumed by both the
|
||||
// cart's order summary (CartContent.tsx) and the /versand policy page, so
|
||||
// the two can never drift apart.
|
||||
//
|
||||
// The delivery-timeframe numbers (handling/transit days, Art. 246a § 1
|
||||
// Abs. 1 Nr. 8 EGBGB) used to live here too, but now come from Payload's
|
||||
// Shipping Settings collection instead (see lib/payload.ts's
|
||||
// getShippingSettings()) — that duplication is exactly why the
|
||||
// ShippingMethods CMS title once carried a different, drifted day-range
|
||||
// than this file did. Cost/threshold below have the same drift risk
|
||||
// against Payload's ShippingMethods price/freeShippingThreshold fields,
|
||||
// not yet addressed here.
|
||||
export const SHIPPING_COST = 2.9;
|
||||
export const FREE_SHIPPING_THRESHOLD = 39;
|
||||
|
||||
// Kept as an explicit range (not "so schnell wie möglich") per Art. 246a
|
||||
// § 1 Abs. 1 Nr. 8 EGBGB — German law requires disclosing a concrete
|
||||
// delivery timeframe before contract conclusion, and split into
|
||||
// Bearbeitungszeit/Versanddauer so it's clear whether processing time is
|
||||
// included in the stated number, not just a single ambiguous figure.
|
||||
export const HANDLING_DAYS = { min: 1, max: 2 };
|
||||
export const TRANSIT_DAYS_DE = { min: 2, max: 4 };
|
||||
export const TOTAL_DAYS_DE = {
|
||||
min: HANDLING_DAYS.min + TRANSIT_DAYS_DE.min,
|
||||
max: HANDLING_DAYS.max + TRANSIT_DAYS_DE.max,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user