From bfce7dcca06978103f4bca9e2991144bde53e07e Mon Sep 17 00:00:00 2001 From: Unchained Date: Tue, 24 Mar 2026 20:14:42 +0200 Subject: [PATCH] fix: filter bundles from homepage, sitemap, and static params --- src/app/[locale]/page.tsx | 5 ++++- src/app/[locale]/products/[slug]/page.tsx | 5 ++++- src/app/sitemap.ts | 6 +++++- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/app/[locale]/page.tsx b/src/app/[locale]/page.tsx index 177f7d2..b592002 100644 --- a/src/app/[locale]/page.tsx +++ b/src/app/[locale]/page.tsx @@ -40,7 +40,10 @@ export default async function Homepage({ params }: { params: Promise<{ locale: s console.log("Failed to fetch products during build"); } - const featuredProducts = products?.slice(0, 4) || []; + const filteredProducts = products?.filter( + (p: any) => !p.name.includes("2x Set") && !p.name.includes("3x Set") + ); + const featuredProducts = filteredProducts?.slice(0, 4) || []; const hasProducts = featuredProducts.length > 0; const basePath = `/${validLocale}`; diff --git a/src/app/[locale]/products/[slug]/page.tsx b/src/app/[locale]/products/[slug]/page.tsx index 95467da..94afb09 100644 --- a/src/app/[locale]/products/[slug]/page.tsx +++ b/src/app/[locale]/products/[slug]/page.tsx @@ -20,7 +20,10 @@ export async function generateStaticParams() { try { const saleorLocale = locale === "sr" ? "SR" : "EN"; const products = await getProducts(saleorLocale, 100); - products.forEach((product: Product) => { + const filteredProducts = products.filter( + (p: Product) => !p.name.includes("2x Set") && !p.name.includes("3x Set") + ); + filteredProducts.forEach((product: Product) => { params.push({ locale, slug: product.slug }); }); } catch (e) { diff --git a/src/app/sitemap.ts b/src/app/sitemap.ts index a509bfc..96fd317 100644 --- a/src/app/sitemap.ts +++ b/src/app/sitemap.ts @@ -80,9 +80,13 @@ export default async function sitemap(): Promise { }, ]; + const filteredProducts = products.filter( + (p: any) => !p.name.includes("2x Set") && !p.name.includes("3x Set") + ); + const productUrls: SitemapEntry[] = []; - for (const product of products) { + for (const product of filteredProducts) { const hreflangs: Record = {}; for (const locale of SUPPORTED_LOCALES) { const path = locale === "sr" ? `/products/${product.slug}` : `/${locale}/products/${product.slug}`;