← back to Designer Wallcoverings
auto-save: 2026-06-23T09:50:51 (1 files) — shopify/scripts/tres-tintas-designer-descriptions.js
a8829a6a23e98a3437ff0f0993fa6a7bf9dba61b · 2026-06-23 09:50:57 -0700 · Steve Abrams
Files touched
M shopify/scripts/tres-tintas-designer-descriptions.js
Diff
commit a8829a6a23e98a3437ff0f0993fa6a7bf9dba61b
Author: Steve Abrams <steve@designerwallcoverings.com>
Date: Tue Jun 23 09:50:57 2026 -0700
auto-save: 2026-06-23T09:50:51 (1 files) — shopify/scripts/tres-tintas-designer-descriptions.js
---
shopify/scripts/tres-tintas-designer-descriptions.js | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/shopify/scripts/tres-tintas-designer-descriptions.js b/shopify/scripts/tres-tintas-designer-descriptions.js
index 7275cd3a..8613aa65 100644
--- a/shopify/scripts/tres-tintas-designer-descriptions.js
+++ b/shopify/scripts/tres-tintas-designer-descriptions.js
@@ -161,12 +161,19 @@ async function main() {
const d = n.descriptionHtml || '';
const id = n.id.split('/').pop();
const hasTable = /<h3>\s*Specifications\s*<\/h3>/i.test(d) && /<table/i.test(d);
- if (!hasTable) continue;
+ const hasDescription = /landscape|botanical|geometric|floral|abstract|damask|stripe/i.test(d);
+
+ // Process ALL products (affected = has table OR needs backfill)
+ const needsBackfill = !hasDescription || !d.includes('custom.origin');
+ if (!needsBackfill && !hasTable) continue;
+
affected++;
if (done.has(id)) continue;
if (processed >= LIMIT) continue;
- const rows = parseTable(d);
+ // For products with tables, parse specs. For others, use defaults
+ const rows = hasTable ? parseTable(d) : { Material: 'Non-Woven', Origin: 'Spain' };
+
const img = n.featuredImage?.url;
if (!img) { console.log(` !! ${id} no image — SKIP`); continue; }
@@ -179,8 +186,9 @@ async function main() {
catch (err) { console.log(` !! ${id} ${err.message} — SKIP`); continue; }
processed++;
- if (!APPLY || processed <= 3) {
+ if (!APPLY || processed <= 5) {
console.log(`\n ${id} ${n.title}`);
+ console.log(` status: ${hasTable ? 'had-table' : 'needs-backfill'}`);
console.log(` colorways: ${(ai.colorways||[]).join(', ')} | style: ${(ai.style||[]).join('/')} | motif: ${ai.motif}`);
console.log(` metafield backfill: ${Object.keys(rows).filter(k=>SPEC_MAP[k]).map(k=>`${SPEC_MAP[k].ns}.${SPEC_MAP[k].key}`).join(', ')}`);
console.log(` desc: ${desc.replace(/<[^>]+>/g,'').slice(0,180)}…`);
← e87f44f9 fix: infinite scroll for standard Shopify collection paginat
·
back to Designer Wallcoverings
·
Fix infinite scroll: add data-dw-infinite wrapper to collect 6479af2e →