[object Object]

← back to Dw Validator Debug TK11314

template: map global.width metafield so forked importers clear the activation gate

98dded9ac5a317f200d49b5437f09d5093ae9574 · 2026-08-31 10:43:44 -0700 · Steve Abrams

Files touched

Diff

commit 98dded9ac5a317f200d49b5437f09d5093ae9574
Author: Steve Abrams <steve@designerwallcoverings.com>
Date:   Mon Aug 31 10:43:44 2026 -0700

    template: map global.width metafield so forked importers clear the activation gate
---
 shopify/scripts/templates/new-product-import-template.js | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/shopify/scripts/templates/new-product-import-template.js b/shopify/scripts/templates/new-product-import-template.js
index 73a3d8ec..dcb85b0a 100644
--- a/shopify/scripts/templates/new-product-import-template.js
+++ b/shopify/scripts/templates/new-product-import-template.js
@@ -120,7 +120,10 @@ async function importProducts() {
   };
 
   for (const product of products) {
-    const { mfrSku, title, description, price, imageUrl, color, pattern } = product;
+    // `width` MUST come from your vendor *_catalog (join by dw_sku) inside
+    // fetchProductsFromSource(). e.g. SELECT width FROM <vendor>_catalog WHERE dw_sku = $1.
+    // Format like the live importers do: "27 Inches" (a non-empty single_line_text value).
+    const { mfrSku, title, description, price, imageUrl, color, pattern, width } = product;
 
     try {
       // ===== STEP 1: CHECK FOR DUPLICATE =====
@@ -187,6 +190,16 @@ async function importProducts() {
           { namespace: 'custom', key: 'manufacturer_sku', value: mfrSku, type: 'single_line_text_field' },
           { namespace: 'dwc', key: 'manufacturer_sku', value: mfrSku, type: 'single_line_text_field' },
           { namespace: 'global', key: 'Brand', value: VENDOR_NAME, type: 'single_line_text_field' },
+          // ── WIDTH — REQUIRED FOR ACTIVATION. validate-before-activate.js hard-requires a
+          //    non-empty global.width (or custom.width). Key MUST be lowercase 'width'
+          //    (the gate reads key:'width'; 'Width' silently fails). Push ONLY when non-empty —
+          //    an empty value still fails the gate AND would clobber a real value on re-import,
+          //    so leaving it off correctly parks the product as DRAFT + Needs-Width.
+          //    ⚠️ FORKS: do NOT delete this block. Dropping it = every product you import can
+          //    never leave DRAFT (this is exactly the template omission fixed under TK-11024).
+          ...(width && String(width).trim()
+            ? [{ namespace: 'global', key: 'width', value: String(width).trim(), type: 'single_line_text_field' }]
+            : []),
         ],
       });
 

← 2978dddb auto-data-snapshot: 2026-08-31T09:29:05 (1 data files) — DW-  ·  back to Dw Validator Debug TK11314  ·  TK-13 Option B: stop git-bloat churn — untrack 524 regenerab 1eac8b4a →