← back to Designer Wallcoverings
Gate below-images Pattern Description block on live theme (short desc -> right/Specs only)
a0294b56ef501900a7a9adec687bf3607c21ef62 · 2026-09-08 12:30:45 -0700 · Steve Abrams
Live theme 145121607731 (carnegie-color-swatch): the below-images 'Pattern
Description' block in snippets/product-gallery.liquid had no length gate, so
SHORT descriptions duplicated (right under Specs AND wide below images).
Wrapped it in {% if product == blank or desc_len > 1500 %} to match the
right-side product-description-meta.liquid (<= 1500) so each description shows
in exactly one place. Short -> right/Specs; long Kravet-family (>1500) stay
wide below images; editor onboarding unchanged. BEFORE snippet saved for
one-command rollback; apply+verify script committed.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TLitTyFFwngLVzBZDtHiA7
Files touched
A shopify/apply-pattern-desc-fix.sh
Diff
commit a0294b56ef501900a7a9adec687bf3607c21ef62
Author: Steve Abrams <steve@designerwallcoverings.com>
Date: Tue Sep 8 12:30:45 2026 -0700
Gate below-images Pattern Description block on live theme (short desc -> right/Specs only)
Live theme 145121607731 (carnegie-color-swatch): the below-images 'Pattern
Description' block in snippets/product-gallery.liquid had no length gate, so
SHORT descriptions duplicated (right under Specs AND wide below images).
Wrapped it in {% if product == blank or desc_len > 1500 %} to match the
right-side product-description-meta.liquid (<= 1500) so each description shows
in exactly one place. Short -> right/Specs; long Kravet-family (>1500) stay
wide below images; editor onboarding unchanged. BEFORE snippet saved for
one-command rollback; apply+verify script committed.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TLitTyFFwngLVzBZDtHiA7
---
shopify/apply-pattern-desc-fix.sh | 63 +++++++++++++++++++++++++++++++++++++++
1 file changed, 63 insertions(+)
diff --git a/shopify/apply-pattern-desc-fix.sh b/shopify/apply-pattern-desc-fix.sh
new file mode 100644
index 00000000..2c1c1a63
--- /dev/null
+++ b/shopify/apply-pattern-desc-fix.sh
@@ -0,0 +1,63 @@
+#!/usr/bin/env bash
+# Apply + verify: gate the below-images "Pattern Description" block on the LIVE theme
+# so SHORT descriptions render ONLY on the right under Specs (Steve 2026-09-08).
+# Live theme: 145121607731 (carnegie-color-swatch). Reversible: BEFORE backup is saved alongside.
+set -euo pipefail
+STORE="designer-laboratory-sandbox.myshopify.com"
+THEME=145121607731
+KEY="snippets/product-gallery.liquid"
+PATCHED="/Users/macstudio3/Projects/Designer-Wallcoverings/shopify/theme-backups/product-gallery.LIVE-145121607731-PATCHED-20260908-122400.liquid"
+T=$(grep -m1 '^SHOPIFY_FULL_ACCESS_TOKEN=' ~/Projects/secrets-manager/.env | cut -d= -f2- | tr -d '"'"'"' | tr -d '\r')
+API="https://$STORE/admin/api/2024-10"
+
+echo "==> 1. PUT patched snippet to LIVE theme $THEME"
+python3 - "$T" "$PATCHED" "$API" "$THEME" "$KEY" <<'PY'
+import sys,json,urllib.request,urllib.error
+tok,patched,api,theme,key=sys.argv[1:6]
+val=open(patched).read()
+body=json.dumps({"asset":{"key":key,"value":val}}).encode()
+req=urllib.request.Request(f"{api}/themes/{theme}/assets.json",data=body,method="PUT",
+ headers={"X-Shopify-Access-Token":tok,"Content-Type":"application/json"})
+try:
+ r=urllib.request.urlopen(req); a=json.load(r)["asset"]
+ print(" HTTP",r.status,"| updated_at:",a.get("updated_at"))
+except urllib.error.HTTPError as e:
+ print(" ERROR",e.code,e.read().decode()[:400]); sys.exit(1)
+PY
+
+echo "==> 2. Re-fetch asset; assert the length gate is now present"
+python3 - "$T" "$API" "$THEME" "$KEY" <<'PY'
+import sys,json,urllib.request
+tok,api,theme,key=sys.argv[1:5]
+import urllib.parse
+u=f"{api}/themes/{theme}/assets.json?asset%5Bkey%5D={urllib.parse.quote(key)}"
+v=json.load(urllib.request.urlopen(urllib.request.Request(u,headers={"X-Shopify-Access-Token":tok})))["asset"]["value"]
+ok = ("assign desc_len" in v) and ("desc_len > 1500" in v)
+print(" gate present:", ok)
+print(" 'Pattern Description:' occurrences in snippet source:", v.count("Pattern Description:"))
+PY
+
+echo "==> 3. Verify RENDERED PDP for Ashburn-Cassis (short desc -> expect 0 below-images blocks)"
+python3 - "$T" "$API" <<'PY'
+import sys,json,urllib.request,re
+tok,api=sys.argv[1:3]
+def gql(q):
+ req=urllib.request.Request(f"{api}/graphql.json",data=json.dumps({"query":q}).encode(),
+ headers={"X-Shopify-Access-Token":tok,"Content-Type":"application/json"})
+ return json.load(urllib.request.urlopen(req))
+d=gql('{ products(first:1, query:"sku:DWKR-191028"){edges{node{handle title}}} }')
+edges=d["data"]["products"]["edges"]
+if not edges:
+ print(" could not resolve handle for DWKR-191028 (check manually)"); sys.exit(0)
+h=edges[0]["node"]["handle"]; url=f"https://www.designerwallcoverings.com/products/{h}"
+print(" PDP:",url)
+try:
+ html=urllib.request.urlopen(urllib.request.Request(url,headers={"User-Agent":"Mozilla/5.0"})).read().decode("utf-8","ignore")
+ n=len(re.findall(r"Pattern Description:", html))
+ print(f" below-images 'Pattern Description:' count on rendered page: {n} (expect 0)")
+ print(" right-side under-Specs DESCRIPTION present:", "dw-specs-desc" in html)
+except Exception as ex:
+ print(" render fetch note:",repr(ex),"- eyeball the PDP in a browser")
+PY
+echo "==> DONE. Rollback if needed:"
+echo " re-PUT the BEFORE backup: product-gallery.LIVE-145121607731-BEFORE-20260908-122400.liquid"
← 5d73ddff guard TK-10965: skip $0 variants in hourly inventory re-infl
·
back to Designer Wallcoverings
·
Accept phthalate-free material copy in activation validation 1d91950f →