Follow Products.description consolidation to richText-only
Backend dropped the plain-text description field in favor of a single richText one (see docker/payload commit 1ba8d07). Renders formatted (bold/italic/multiple paragraphs) via the shared RichText component on the PDP (der-eine, tasse-die-pause); everywhere else (Passend-dazu cards, Product JSON-LD, homepage spotlight fallback) derives plain text at read time via a new extractPlainText() helper instead of a second field. Removes the description line from cart line items entirely — it only bloated the cart with no real benefit there. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01J1Hu5bZ1kZUgKhab6yNwCt
This commit is contained in:
@@ -2,6 +2,7 @@ import Link from "next/link";
|
||||
import Image from "next/image";
|
||||
import { AddToCartButton } from "../../components/AddToCartButton";
|
||||
import { Reveal } from "../../components/Reveal";
|
||||
import { RichText } from "../../components/RichText";
|
||||
import { getProductBySlug, getShippingSettings, getDefaultTaxRatePercent, getKleinunternehmer } from "../../lib/payload";
|
||||
import { formatPrice, discountPercent } from "../../lib/format";
|
||||
import { effectiveTaxRate } from "../../lib/cartTotals";
|
||||
@@ -50,7 +51,7 @@ export async function Hero() {
|
||||
{product?.name ?? "Tasse"}
|
||||
</p>
|
||||
|
||||
{product?.description && <p className="text-body text-text-body">{product.description}</p>}
|
||||
{product?.description ? <RichText content={product.description} /> : null}
|
||||
|
||||
<div className="flex flex-col gap-1 items-start">
|
||||
{product && (
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import Image from "next/image";
|
||||
import { AddToCartButton } from "../../components/AddToCartButton";
|
||||
import { Reveal } from "../../components/Reveal";
|
||||
import { RichText } from "../../components/RichText";
|
||||
import { getProductBySlug, getShippingSettings, getDefaultTaxRatePercent, getKleinunternehmer } from "../../lib/payload";
|
||||
import { formatPrice, discountPercent } from "../../lib/format";
|
||||
import { effectiveTaxRate } from "../../lib/cartTotals";
|
||||
@@ -48,7 +49,7 @@ export async function Pricing() {
|
||||
>
|
||||
{product.name}
|
||||
</p>
|
||||
{product.description && <p className="text-body-sm text-text-primary">{product.description}</p>}
|
||||
{product.description ? <RichText content={product.description} /> : null}
|
||||
</div>
|
||||
|
||||
<div className="flex flex-col gap-3 items-start w-full lg:w-[18.75rem] lg:shrink-0">
|
||||
|
||||
@@ -11,7 +11,7 @@ import { buildProductSchema } from "../lib/structuredData";
|
||||
export async function generateMetadata(): Promise<Metadata> {
|
||||
const product = await getProductBySlug("tasse-die-pause");
|
||||
const title = product ? `${product.name} – einfach produktiv.` : "Tasse – einfach produktiv.";
|
||||
const description = product?.description ?? undefined;
|
||||
const description = product?.descriptionText || undefined;
|
||||
return {
|
||||
title,
|
||||
description,
|
||||
|
||||
Reference in New Issue
Block a user