Dynamic AGB address, real shipping costs on /versand instead of hardcoded constants
- AGB: name/address/email now come from company-settings via new VertragspartnerBlock (mid-document, see LegalPages.ts's contentPart2). - VersandSections/VersandModal/CartContent/CheckoutContent/versand page: shipping cost and free-shipping threshold now come from the real ShippingMethods data (already fetched elsewhere for checkout), not the hardcoded lib/shipping.ts constants — those had already drifted from the real Payload values once. lib/shipping.ts deleted, nothing left to export. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -397,6 +397,11 @@ export function CheckoutContent({
|
||||
selectedShipping?.freeShippingThreshold !== undefined &&
|
||||
subtotal >= selectedShipping.freeShippingThreshold;
|
||||
const shipping = items.length === 0 || !cartHasShippableItem(items) || freeShipping ? 0 : selectedShipping?.price ?? 0;
|
||||
// For VersandModal — same "lowest freeShippingThreshold among active
|
||||
// methods" rule as CartContent.tsx/getTrustBadges(), independent of
|
||||
// whichever method is currently selected in the radio list above.
|
||||
const shippingMethodThresholds = shippingMethods.map((m) => m.freeShippingThreshold).filter((t): t is number => t !== null);
|
||||
const lowestFreeShippingThreshold = shippingMethodThresholds.length > 0 ? Math.min(...shippingMethodThresholds) : null;
|
||||
const { totalSavings, discountAmount, total } = computeCartTotals(items, shipping, discount);
|
||||
const taxBreakdown = computeTaxBreakdown(
|
||||
items.map(({ entry, product }) => ({
|
||||
@@ -1551,7 +1556,13 @@ export function CheckoutContent({
|
||||
</Reveal>
|
||||
</form>
|
||||
|
||||
<VersandModal open={versandOpen} onClose={() => setVersandOpen(false)} shipping={shippingSettings} />
|
||||
<VersandModal
|
||||
open={versandOpen}
|
||||
onClose={() => setVersandOpen(false)}
|
||||
shipping={shippingSettings}
|
||||
shippingCost={shippingMethods[0]?.price ?? 0}
|
||||
freeShippingThreshold={lowestFreeShippingThreshold}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user