[object Object]

← back to Rebel Walls Push

relabel-units: skip sample products from Roll→SqMeter relabel

09027cf421cba2e7040414811fa410da6efdbef3 · 2026-07-30 04:06:22 -0700 · Steve Abrams

84 'Memo Sample' products were wrongly included in the fix set because
'Default Title' matched WRONG_MURAL_LABELS. Added isSampleProduct() guard
that checks title for 'memo sample' / ' sample' / ends-with 'sample'.
Dry-run now shows 370 true mural products needing relabel (was 454).

Co-author: steve@designerwallcoverings.com

Files touched

Diff

commit 09027cf421cba2e7040414811fa410da6efdbef3
Author: Steve Abrams <steve@designerwallcoverings.com>
Date:   Thu Jul 30 04:06:22 2026 -0700

    relabel-units: skip sample products from Roll→SqMeter relabel
    
    84 'Memo Sample' products were wrongly included in the fix set because
    'Default Title' matched WRONG_MURAL_LABELS. Added isSampleProduct() guard
    that checks title for 'memo sample' / ' sample' / ends-with 'sample'.
    Dry-run now shows 370 true mural products needing relabel (was 454).
    
    Co-author: steve@designerwallcoverings.com
---
 scripts/relabel-units.js | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/scripts/relabel-units.js b/scripts/relabel-units.js
index e9917b5..6224a95 100644
--- a/scripts/relabel-units.js
+++ b/scripts/relabel-units.js
@@ -84,7 +84,14 @@ async function fetchAll() {
   return products;
 }
 
+function isSampleProduct(product) {
+  // Memo samples and sample-only products should not be relabeled to "Sold Per Square Meter"
+  const titleLower = product.title.toLowerCase();
+  return titleLower.includes('memo sample') || titleLower.includes(' sample') || titleLower.endsWith('sample');
+}
+
 function needsFix(product) {
+  if (isSampleProduct(product)) return false;
   for (const v of product.variants.edges.map(e => e.node)) {
     for (const o of v.selectedOptions) {
       if (WRONG_MURAL_LABELS.has(o.value.toLowerCase())) return true;

← 5f49d70 TK-10029: add relabel-units.js — dry-run verified, 454 produ  ·  back to Rebel Walls Push  ·  TK-10029: retarget relabel to canonical 'Mural (per m²)' (DT be208a1 →