[object Object]

← back to Chinoiseriewallpaper

pull-from-shopify: use shared classifier with rails primary, local aestheticOf as fallback

78c4d98aaef096df2ef29b81413842f268bba0d8 · 2026-05-25 20:46:11 -0700 · Steve Abrams

Files touched

Diff

commit 78c4d98aaef096df2ef29b81413842f268bba0d8
Author: Steve Abrams <steve@designerwallcoverings.com>
Date:   Mon May 25 20:46:11 2026 -0700

    pull-from-shopify: use shared classifier with rails primary, local aestheticOf as fallback
---
 scripts/pull-from-shopify.js | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/scripts/pull-from-shopify.js b/scripts/pull-from-shopify.js
index 884f785..ef07328 100644
--- a/scripts/pull-from-shopify.js
+++ b/scripts/pull-from-shopify.js
@@ -4,6 +4,8 @@
 const { execFileSync } = require('child_process');
 const fs = require('fs');
 const path = require('path');
+const { classifyAesthetic } = require('../../_shared/microsite-aesthetic');
+const SITE_CFG_RAILS = (() => { try { return require('../site.config.json').rails || []; } catch { return []; } })();
 
 const OUT = path.join(__dirname, '..', 'data', 'products.json');
 
@@ -43,6 +45,12 @@ function aestheticOf(tags, title) {
   return 'chinoiserie';
 }
 
+function classifyForSite(tags, title) {
+  const railsMatch = classifyAesthetic(tags, SITE_CFG_RAILS);
+  if (railsMatch && railsMatch !== 'all') return railsMatch;
+  return aestheticOf(tags, title);
+}
+
 (async () => {
   const all = [];
   for (let page = 1; page <= 40; page++) {
@@ -80,7 +88,7 @@ function aestheticOf(tags, title) {
         image_url: images[0],
         images,
         tags: p.tags || [],
-        aesthetic: aestheticOf(p.tags, p.title),
+        aesthetic: classifyForSite(p.tags, p.title),
         price,
         compare_price: comparePrice,
         product_url: `https://designerwallcoverings.com/products/${p.handle}`,

← 4901605 retag aesthetic from PG: 1193 rows updated  ·  back to Chinoiseriewallpaper  ·  remove DW vendor leaks from customer UI f031da9 →