diff --git a/prerender/seo/category.cjs b/prerender/seo/category.cjs index 671b4e5..42beb24 100644 --- a/prerender/seo/category.cjs +++ b/prerender/seo/category.cjs @@ -1,6 +1,11 @@ const generateCategoryJsonLd = (category, products = [], baseUrl, config) => { const categoryUrl = `${baseUrl}/Kategorie/${category.seoName}`; + // Calculate price valid date (current date + 3 months) + const priceValidDate = new Date(); + priceValidDate.setMonth(priceValidDate.getMonth() + 3); + const priceValidUntil = priceValidDate.toISOString().split("T")[0]; + const jsonLd = { "@context": "https://schema.org/", "@type": "CollectionPage", @@ -57,6 +62,7 @@ const generateCategoryJsonLd = (category, products = [], baseUrl, config) => { url: `${baseUrl}/Artikel/${product.seoName}`, price: product.price && !isNaN(product.price) ? product.price.toString() : "0.00", priceCurrency: config.currency, + priceValidUntil: priceValidUntil, availability: product.available ? "https://schema.org/InStock" : "https://schema.org/OutOfStock",