← back to Designer Wallcoverings
TK-10661: normalize Sample match (downcase|strip) per codex review — excludes 'SAMPLE'/'Sample ' too
c692cedcda3df92aaf9fe04f1d2ebb77ee68c592 · 2026-08-18 09:35:19 -0700 · Steve Abrams
Files touched
M shopify/theme-LIVE-591/snippets/structured-data.liquid
Diff
commit c692cedcda3df92aaf9fe04f1d2ebb77ee68c592
Author: Steve Abrams <steve@designerwallcoverings.com>
Date: Tue Aug 18 09:35:19 2026 -0700
TK-10661: normalize Sample match (downcase|strip) per codex review — excludes 'SAMPLE'/'Sample ' too
---
shopify/theme-LIVE-591/snippets/structured-data.liquid | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/shopify/theme-LIVE-591/snippets/structured-data.liquid b/shopify/theme-LIVE-591/snippets/structured-data.liquid
index c8e9faeb..56ce7c21 100644
--- a/shopify/theme-LIVE-591/snippets/structured-data.liquid
+++ b/shopify/theme-LIVE-591/snippets/structured-data.liquid
@@ -307,13 +307,15 @@
Pick the first AVAILABLE non-Sample variant; fall back to the first non-Sample variant;
finally fall back to selected_variant (guards a product that somehow has only a Sample).
{%- endcomment -%}
- {%- comment -%} nil-falsiness + unless (NOT `== blank`, which does not compare reliably in Liquid) {%- endcomment -%}
+ {%- comment -%} nil-falsiness + unless (NOT `== blank`, which does not compare reliably in Liquid). Sample match is case/whitespace-normalized so 'SAMPLE'/'Sample ' are also excluded. {%- endcomment -%}
{%- for v in product.variants -%}
- {%- if v.title != 'Sample' and v.available -%}{%- assign offer_variant = v -%}{%- break -%}{%- endif -%}
+ {%- assign vt = v.title | downcase | strip -%}
+ {%- if vt != 'sample' and v.available -%}{%- assign offer_variant = v -%}{%- break -%}{%- endif -%}
{%- endfor -%}
{%- unless offer_variant -%}
{%- for v in product.variants -%}
- {%- if v.title != 'Sample' -%}{%- assign offer_variant = v -%}{%- break -%}{%- endif -%}
+ {%- assign vt = v.title | downcase | strip -%}
+ {%- if vt != 'sample' -%}{%- assign offer_variant = v -%}{%- break -%}{%- endif -%}
{%- endfor -%}
{%- endunless -%}
{%- unless offer_variant -%}{%- assign offer_variant = selected_variant -%}{%- endunless -%}
← 48cbba4b TK-10649: targeted 3-row Shopify->PG reconcile for cross-ven
·
back to Designer Wallcoverings
·
TK-10661: revert theme JSON-LD fix — offer_variant loop work bcea140f →