← back to Designer Wallcoverings
Carl Robinson: add 'Wallcovering' type descriptor to titles + live Shopify title-update script
0d777f6f60dd6a09aff22a78f4b0323128e508ba · 2026-07-06 14:15:14 -0700 · steve@designerwallcoverings.com
Files touched
M scripts/wallquest-refresh/build-pr-drafts-carl-robinson.cjsM scripts/wallquest-refresh/update-shopify-titles-carl-robinson.cjs
Diff
commit 0d777f6f60dd6a09aff22a78f4b0323128e508ba
Author: steve@designerwallcoverings.com <steve@designerwallcoverings.com>
Date: Mon Jul 6 14:15:14 2026 -0700
Carl Robinson: add 'Wallcovering' type descriptor to titles + live Shopify title-update script
---
.../build-pr-drafts-carl-robinson.cjs | 2 +-
.../update-shopify-titles-carl-robinson.cjs | 23 +++++++++++-----------
2 files changed, 13 insertions(+), 12 deletions(-)
diff --git a/scripts/wallquest-refresh/build-pr-drafts-carl-robinson.cjs b/scripts/wallquest-refresh/build-pr-drafts-carl-robinson.cjs
index 1811fdfd..9e043ec1 100644
--- a/scripts/wallquest-refresh/build-pr-drafts-carl-robinson.cjs
+++ b/scripts/wallquest-refresh/build-pr-drafts-carl-robinson.cjs
@@ -35,7 +35,7 @@ for (const r of recs) {
if (BAD_NAME.test(patternName)) patternName = r.mfr_sku; // NEVER "Unknown" (DW rule)
const color = toTitleCase(r.color || r.ai_dominant_color || '');
// DW title format: "Pattern Color | Brand" — Title Case, NO banned word "Wallpaper"
- const title = cleanWallpaper(`${patternName}${color ? ' ' + color : ''} | Phillipe Romano`);
+ const title = cleanWallpaper(`${patternName}${color ? ' ' + color : ''} Wallcovering | Phillipe Romano`);
const tags = [
city, material, 'Natural Texture', 'Grasscloth & Naturals', 'Phillipe Romano',
...(r.ai_styles || []), ...(r.ai_colors || []), color,
diff --git a/scripts/wallquest-refresh/update-shopify-titles-carl-robinson.cjs b/scripts/wallquest-refresh/update-shopify-titles-carl-robinson.cjs
index 0f913c2f..82b2d57f 100644
--- a/scripts/wallquest-refresh/update-shopify-titles-carl-robinson.cjs
+++ b/scripts/wallquest-refresh/update-shopify-titles-carl-robinson.cjs
@@ -1,6 +1,7 @@
-// Update the 67 live Carl Robinson product TITLES to include the material descriptor
-// (Cork / Grasscloth / Paperweave / Mica / Netting …). Format: "{City} {Material} {Color} | Phillipe Romano".
-// Anchors on carl_robinson_catalog.shopify_product_id. Idempotent (skips if already correct). No "Wallpaper".
+// Update the 67 live Carl Robinson product TITLES to include the "Wallcovering" type descriptor:
+// "{City} {Material} {Color} Wallcovering | Phillipe Romano"
+// Reads carl_robinson_catalog (pattern_name = "City Material", color_name). Idempotent.
+// Env: SHOPIFY_ADMIN_TOKEN, DATABASE_URL.
const https = require('https');
const { Client } = require('pg');
const STORE = 'designer-laboratory-sandbox.myshopify.com';
@@ -9,7 +10,7 @@ const TOKEN = process.env.SHOPIFY_ADMIN_TOKEN;
if (!TOKEN) { console.error('no SHOPIFY_ADMIN_TOKEN'); process.exit(1); }
const CONN = process.env.DATABASE_URL || 'postgresql://dw_admin@127.0.0.1:5432/dw_unified';
const sleep = ms => new Promise(r => setTimeout(r, ms));
-const clean = s => s.replace(/\bWallpapers?\b/gi, 'Wallcovering');
+const clean = s => (s || '').replace(/\bWallpapers?\b/gi, 'Wallcovering'); // never the banned word
function rest(method, path, body) {
return new Promise((resolve, reject) => {
@@ -24,20 +25,20 @@ function rest(method, path, body) {
(async () => {
const db = new Client({ connectionString: CONN }); await db.connect();
- const { rows } = await db.query(`SELECT shopify_product_id, pattern_name, color_name FROM carl_robinson_catalog WHERE shopify_product_id IS NOT NULL ORDER BY dw_sku`);
- console.log(`updating ${rows.length} product titles (material-inclusive)…`);
- let set = 0, already = 0, err = 0;
+ const { rows } = await db.query("SELECT pattern_name, color_name, shopify_product_id FROM carl_robinson_catalog WHERE shopify_product_id IS NOT NULL ORDER BY dw_sku");
+ console.log(`updating ${rows.length} titles…`);
+ let set = 0, same = 0, err = 0;
for (const r of rows) {
- const title = clean(`${r.pattern_name}${r.color_name ? ' ' + r.color_name : ''} | Phillipe Romano`); // e.g. "Kennebunkport Cork Chalk | Phillipe Romano"
+ const title = clean(`${r.pattern_name}${r.color_name ? ' ' + r.color_name : ''} Wallcovering | Phillipe Romano`);
try {
- const cur = await rest('GET', `/products/${r.shopify_product_id}.json?fields=id,title`);
- if (cur.j?.product?.title === title) { already++; continue; }
+ const g = await rest('GET', `/products/${r.shopify_product_id}.json?fields=id,title`);
+ if (g.j?.product?.title === title) { same++; continue; }
const u = await rest('PUT', `/products/${r.shopify_product_id}.json`, { product: { id: r.shopify_product_id, title } });
if (u.status >= 200 && u.status < 300) { set++; console.log(`✓ ${title}`); }
else { err++; console.log(`✗ ${r.shopify_product_id} HTTP ${u.status}`); }
} catch (e) { err++; console.log(`✗ ${r.shopify_product_id} ${String(e).slice(0, 80)}`); }
await sleep(550);
}
- console.log(`\nTITLE UPDATE DONE: set=${set} already-correct=${already} errors=${err}`);
+ console.log(`\nTITLE UPDATE DONE: set=${set} already-correct=${same} errors=${err}`);
await db.end();
})().catch(e => { console.error('FATAL', e.message); process.exit(1); });
← f5ba693d PR rescope: brand-leak detection (found 11 Kravet mis-vendor
·
back to Designer Wallcoverings
·
Add --fill-catalog: backfill single-roll W/L from thibaut_ca 1e1c3b22 →