From aeefd7649699a795d59fcd826c075e1ea968b63c Mon Sep 17 00:00:00 2001 From: Christian Vidal Wolf Date: Thu, 5 Feb 2026 08:48:27 +0100 Subject: [PATCH] feat: Make Buy Box sheet matching even more aggressive --- services/dataProcessor.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/services/dataProcessor.ts b/services/dataProcessor.ts index b2ed8bd..aa08150 100644 --- a/services/dataProcessor.ts +++ b/services/dataProcessor.ts @@ -2164,11 +2164,12 @@ export const processBuyBoxExcel = async (fileOrBuffer: File | ArrayBuffer): Prom console.log('[BuyBox] Available sheets:', workbook.SheetNames.join(', ')); for (const config of BB_SHEET_CONFIG) { - // Find sheet case-insensitively and with flexible separators (BB_ES, BB-ES, BB ES) + // Find sheet case-insensitively and with flexible separators (BB_ES, BB-ES, BB ES, ES BB) const sheetName = workbook.SheetNames.find(name => { const n = name.toUpperCase().replace(/[-_ ]/g, ''); const target = config.sheet.toUpperCase().replace(/[-_ ]/g, ''); - return n === target; + // Also match if the sheet is just the country code or contains 'BB' and the country code + return n === target || n === config.country || (n.includes('BB') && n.includes(config.country)); }); if (!sheetName) {