← back to Designer Wallcoverings
scan-active-dups: filter to exact PREFIX- bases (loose Shopify sku: search made DWK absorb DWKK/DWKN)
139f7c9b7c4cc9f76902c5745dd3f6815be3e018 · 2026-06-12 10:29:49 -0700 · SteveStudio2
Files touched
M shopify/scripts/scan-active-dups.js
Diff
commit 139f7c9b7c4cc9f76902c5745dd3f6815be3e018
Author: SteveStudio2 <steve@designerwallcoverings.com>
Date: Fri Jun 12 10:29:49 2026 -0700
scan-active-dups: filter to exact PREFIX- bases (loose Shopify sku: search made DWK absorb DWKK/DWKN)
---
shopify/scripts/scan-active-dups.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/shopify/scripts/scan-active-dups.js b/shopify/scripts/scan-active-dups.js
index 634cd1f4..7fa0dccd 100644
--- a/shopify/scripts/scan-active-dups.js
+++ b/shopify/scripts/scan-active-dups.js
@@ -20,7 +20,7 @@ async function scan(pfx) {
const map = {}; let after = null, n = 0;
while (true) {
const r = await gr(Q, { q: `sku:${pfx}-*`, after }); const p = r?.data?.products; if (!p) break;
- for (const e of p.edges) { const x = e.node; const vs = x.variants.edges.map(v => v.node); const skus = vs.map(v => v.sku).filter(Boolean); let b = null; for (const s of skus) { if (!/-sample$/i.test(s)) { b = base(s); break; } } if (!b && skus.length) b = base(skus[0]); if (!b) continue; const roll = vs.find(v => !/-sample$/i.test(v.sku || '')); (map[b] = map[b] || []).push({ id: x.id.replace(/.*\//, ''), status: x.status, c: x.createdAt.slice(0, 10), img: !!x.featuredImage, nv: vs.length, roll: roll ? parseFloat(roll.price) : null }); n++; }
+ for (const e of p.edges) { const x = e.node; const vs = x.variants.edges.map(v => v.node); const skus = vs.map(v => v.sku).filter(Boolean); let b = null; for (const s of skus) { if (!/-sample$/i.test(s)) { b = base(s); break; } } if (!b && skus.length) b = base(skus[0]); if (!b) continue; if (!b.startsWith(`${pfx.toUpperCase()}-`)) continue; /* Shopify sku: search is a loose prefix — keep only exact PREFIX- bases (DWK must not absorb DWKK/DWKN) */ const roll = vs.find(v => !/-sample$/i.test(v.sku || '')); (map[b] = map[b] || []).push({ id: x.id.replace(/.*\//, ''), status: x.status, c: x.createdAt.slice(0, 10), img: !!x.featuredImage, nv: vs.length, roll: roll ? parseFloat(roll.price) : null }); n++; }
if (!p.pageInfo.hasNextPage) break; after = p.pageInfo.endCursor;
}
const bothActive = Object.entries(map).filter(([, v]) => v.filter(x => x.status === 'ACTIVE').length >= 2);
← 2d09d654 1838 Wallcoverings: set all 464 live products to DRAFT (Stev
·
back to Designer Wallcoverings
·
copygen: env-configurable Ollama host/model/prompt-prefix (O 67801868 →