[object Object]

← back to Dw Validator Debug TK11314

guard TK-10965: skip $0 variants in hourly inventory re-inflater

5d73ddffa37a9ca61437995249ab6930adc678a5 · 2026-09-08 04:16:00 -0700 · steve@designerwallcoverings.com

inventory-set-2026-newest.mjs was re-stamping on_hand=2026 every hour on the
newest 1000 products with NO price filter, overwriting the Aug 31 fix that
zeroed the 1281 Phillipe Romano Vienna $0 variants. Added price field to SCAN
query and a continue guard so any variant priced $0.00 is never added to the
fixes batch — preventing the hourly cadence from making them orderable again.

Files touched

Diff

commit 5d73ddffa37a9ca61437995249ab6930adc678a5
Author: steve@designerwallcoverings.com <steve@designerwallcoverings.com>
Date:   Tue Sep 8 04:16:00 2026 -0700

    guard TK-10965: skip $0 variants in hourly inventory re-inflater
    
    inventory-set-2026-newest.mjs was re-stamping on_hand=2026 every hour on the
    newest 1000 products with NO price filter, overwriting the Aug 31 fix that
    zeroed the 1281 Phillipe Romano Vienna $0 variants. Added price field to SCAN
    query and a continue guard so any variant priced $0.00 is never added to the
    fixes batch — preventing the hourly cadence from making them orderable again.
---
 shopify/scripts/inventory-set-2026-newest.mjs | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/shopify/scripts/inventory-set-2026-newest.mjs b/shopify/scripts/inventory-set-2026-newest.mjs
index f8058468..8a21d20a 100644
--- a/shopify/scripts/inventory-set-2026-newest.mjs
+++ b/shopify/scripts/inventory-set-2026-newest.mjs
@@ -56,7 +56,7 @@ async function gql(q, v) {
 }
 
 // ---- scan newest N ----
-const SCAN = `query($c:String){products(first:100,after:$c,sortKey:CREATED_AT,reverse:true){pageInfo{hasNextPage endCursor} nodes{id title createdAt variants(first:10){nodes{sku title inventoryItem{id tracked inventoryLevel(locationId:"${LOC}"){quantities(names:["on_hand"]){name quantity}}}}}}}}`;
+const SCAN = `query($c:String){products(first:100,after:$c,sortKey:CREATED_AT,reverse:true){pageInfo{hasNextPage endCursor} nodes{id title createdAt variants(first:10){nodes{sku title price inventoryItem{id tracked inventoryLevel(locationId:"${LOC}"){quantities(names:["on_hand"]){name quantity}}}}}}}}`;
 
 async function scan() {
   let cur = null, prods = [];
@@ -71,6 +71,7 @@ async function scan() {
   let totV = 0, correct = 0; const fixes = [];
   for (const p of prods) for (const v of p.variants.nodes) {
     totV++;
+    if (Number(v.price) === 0) continue; // GUARD TK-10965: never re-inflate $0 quote-only variants
     const ii = v.inventoryItem;
     const tracked = ii?.tracked, lvl = ii?.inventoryLevel;
     const onh = lvl?.quantities?.find(x => x.name === 'on_hand')?.quantity;

← 67a74a1b auto-data-snapshot: 2026-09-07T06:51:38 (2 data files) — sho  ·  back to Dw Validator Debug TK11314  ·  Gate below-images Pattern Description block on live theme (s a0294b56 →