fix(products): fix breadcrumbs and product filtering (backport from main)
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled

This commit is contained in:
2026-02-24 16:04:21 +01:00
parent 915eb61613
commit 5397309103
43805 changed files with 4324295 additions and 3 deletions

View File

@@ -46,6 +46,12 @@ export async function getProductMetadata(
if (fs.existsSync(enFilePath)) {
const fileContent = fs.readFileSync(enFilePath, 'utf8');
const { data } = matter(fileContent);
// Filter out products without images to match getProductBySlug behavior
if (!data.images || data.images.length === 0 || !data.images[0]) {
return null;
}
return {
slug: fileSlug,
frontmatter: {
@@ -59,6 +65,11 @@ export async function getProductMetadata(
const fileContent = fs.readFileSync(filePath, 'utf8');
const { data } = matter(fileContent);
// Filter out products without images to match getProductBySlug behavior
if (!data.images || data.images.length === 0 || !data.images[0]) {
return null;
}
return {
slug: fileSlug,
frontmatter: data as ProductFrontmatter,