u
This commit is contained in:
@@ -329,7 +329,9 @@ const generateProductsXml = (allProductsData = [], baseUrl, config) => {
|
||||
|
||||
// Skip products with excluded terms in title or description
|
||||
const productTitle = (product.name || "").toLowerCase();
|
||||
const productDescription = (product.description || "").toLowerCase();
|
||||
|
||||
// Get description early so we can check it for excluded terms
|
||||
const productDescription = product.kurzBeschreibung || product.description || '';
|
||||
|
||||
const excludedTerms = {
|
||||
title: ['canna', 'hash', 'marijuana', 'marihuana'],
|
||||
@@ -343,7 +345,7 @@ const generateProductsXml = (allProductsData = [], baseUrl, config) => {
|
||||
}
|
||||
|
||||
// Check description for excluded terms
|
||||
if (excludedTerms.description.some(term => productDescription.includes(term))) {
|
||||
if (excludedTerms.description.some(term => productDescription.toLowerCase().includes(term))) {
|
||||
skippedCount++;
|
||||
return;
|
||||
}
|
||||
@@ -420,10 +422,6 @@ const generateProductsXml = (allProductsData = [], baseUrl, config) => {
|
||||
return;
|
||||
}
|
||||
|
||||
// Get description from the appropriate field
|
||||
// TODO: Identify the correct field name used by the product data
|
||||
const productDescription = product.shortDescription || product.longDescription || product.description || '';
|
||||
|
||||
// Check if description is missing or too short (less than 20 characters) - skip if insufficient
|
||||
const originalDescription = productDescription ? cleanTextContent(productDescription) : '';
|
||||
if (!originalDescription || originalDescription.length < 20) {
|
||||
|
||||
Reference in New Issue
Block a user