diff --git a/app/der-eine/components/Pricing.tsx b/app/der-eine/components/Pricing.tsx new file mode 100644 index 0000000..f93df68 --- /dev/null +++ b/app/der-eine/components/Pricing.tsx @@ -0,0 +1,92 @@ +import Image from "next/image"; +import { AddToCartButton } from "../../components/AddToCartButton"; +import { Reveal } from "../../components/Reveal"; +import { getProductBySlug, getShippingSettings, getDefaultTaxRatePercent, getKleinunternehmer } from "../../lib/payload"; +import { formatPrice, discountPercent } from "../../lib/format"; +import { effectiveTaxRate } from "../../lib/cartTotals"; + +// Closing buy banner — same image+price+button card as todo-cards' and +// tasse-die-pause's own Pricing.tsx, repeated here as a second, final +// call-to-action after Testimonials so a visitor who scrolled past the +// Hero's buy button without ordering gets another prompt right before the +// footer. +export async function Pricing() { + const [product, shipping, defaultTaxRate, kleinunternehmer] = await Promise.all([ + getProductBySlug("stift-kugelschreiber"), + getShippingSettings(), + getDefaultTaxRatePercent(), + getKleinunternehmer(), + ]); + if (!product) return null; + const discount = discountPercent(product.price, product.compareAtPrice); + const taxRate = effectiveTaxRate(product, defaultTaxRate); + const fullyOutOfStock = + !product.active || (product.variants.length > 0 ? product.variants.every((v) => v.outOfStock) : product.outOfStock); + const anyLowStock = product.active && (product.variants.length > 0 ? product.variants.some((v) => v.lowStock) : product.lowStock); + + return ( +
+ +
+ {product.name} + {fullyOutOfStock ? ( + + Ausverkauft + + ) : ( + discount !== null && ( + + -{discount}% + + ) + )} +
+ +
+

+ Der Eine. jetzt sichern +

+

+ Ein guter Stift muss nicht kompliziert sein. Hol dir Der Eine. und hab immer etwas zur Hand, wenn dir gerade etwas durch den Kopf geht. +

+
+ +
+
+
+ {discount !== null && ( +

{formatPrice(product.compareAtPrice!)}

+ )} +

{formatPrice(product.price)}

+
+

+ {kleinunternehmer + ? product.noShippingCost + ? "Keine Versandkosten" + : "zzgl. Versand" + : `inkl. ${taxRate}% MwSt. ${product.noShippingCost ? "– keine Versandkosten" : "zzgl. Versand"}`} +

+ {!product.noShippingCost && ( +

+ Lieferzeit: {shipping.totalDays.min}–{shipping.totalDays.max} Werktage innerhalb Deutschlands +

+ )} +
+ {anyLowStock &&

Nur noch wenige verfügbar

} + +
+
+
+ ); +} diff --git a/app/der-eine/components/Testimonials.tsx b/app/der-eine/components/Testimonials.tsx new file mode 100644 index 0000000..3bb57ff --- /dev/null +++ b/app/der-eine/components/Testimonials.tsx @@ -0,0 +1,18 @@ +import { draftMode } from "next/headers"; +import { TestimonialsGrid } from "../../components/TestimonialsGrid"; +import { LiveTestimonialsGrid } from "../../components/LiveTestimonialsGrid"; +import { getTestimonials } from "../../lib/payload"; + +// Payload-driven like todo-cards/newsletter/challenge's own testimonial +// grids (see Testimonials collection's "page" field) — no longer a +// hardcoded array now that "der-eine" is a valid page value there. +export async function Testimonials() { + const { isEnabled: isPreview } = await draftMode(); + const testimonials = await getTestimonials("der-eine", { draft: isPreview }); + + return isPreview ? ( + + ) : ( + + ); +} diff --git a/app/der-eine/page.tsx b/app/der-eine/page.tsx index 9eb1dde..29014a2 100644 --- a/app/der-eine/page.tsx +++ b/app/der-eine/page.tsx @@ -2,6 +2,8 @@ import type { Metadata } from "next"; import { Hero } from "./components/Hero"; import { Focus } from "./components/Focus"; import { PasstDazu } from "./components/PasstDazu"; +import { Testimonials } from "./components/Testimonials"; +import { Pricing } from "./components/Pricing"; import { Footer } from "../components/Footer"; import { getProductBySlug, getCompanySettings } from "../lib/payload"; import { buildProductSchema } from "../lib/structuredData"; @@ -44,6 +46,8 @@ export default async function DerEinePage() {
+ +