← back to Dw Validator Debug TK11314
TK-10661: revert theme JSON-LD fix — offer_variant loop works in liquidjs but NOT on Shopify (renders $4.25 on fresh pages); restored baseline. Reorder (approved, live) is the working fix.
bcea140fac383b90228a668a655cdcc13f1863a4 · 2026-08-18 09:57:54 -0700 · Steve Abrams
Files touched
M shopify/theme-LIVE-591/snippets/structured-data.liquid
Diff
commit bcea140fac383b90228a668a655cdcc13f1863a4
Author: Steve Abrams <steve@designerwallcoverings.com>
Date: Tue Aug 18 09:57:54 2026 -0700
TK-10661: revert theme JSON-LD fix — offer_variant loop works in liquidjs but NOT on Shopify (renders $4.25 on fresh pages); restored baseline. Reorder (approved, live) is the working fix.
---
.../theme-LIVE-591/snippets/structured-data.liquid | 33 +++++-----------------
1 file changed, 7 insertions(+), 26 deletions(-)
diff --git a/shopify/theme-LIVE-591/snippets/structured-data.liquid b/shopify/theme-LIVE-591/snippets/structured-data.liquid
index 56ce7c21..e9c05679 100644
--- a/shopify/theme-LIVE-591/snippets/structured-data.liquid
+++ b/shopify/theme-LIVE-591/snippets/structured-data.liquid
@@ -300,25 +300,6 @@
{% if template contains 'product' %}
{% assign selected_variant = product.selected_or_first_available_variant | default: product.variants.first %}
- {%- comment -%}
- TK-10661: The JSON-LD Offer must reflect the first SELLABLE non-Sample variant, NOT variants[0].
- On ~62% of DW products the $4.25 "Sample" variant sits in position 0, so
- selected_or_first_available_variant returns it and Google indexes the premium product as $4.25.
- 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). Sample match is case/whitespace-normalized so 'SAMPLE'/'Sample ' are also excluded. {%- endcomment -%}
- {%- for v in product.variants -%}
- {%- 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 -%}
- {%- 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 -%}
{% assign product_image = selected_variant.featured_image | default: product.featured_image %}
{%- capture product_name -%}
{{ product.title }}
@@ -345,18 +326,18 @@
"name": {{ product.vendor | json }}
},
{% endif %}
- {% if offer_variant.sku != blank %}
- "sku": {{ offer_variant.sku | json }},
+ {% if selected_variant.sku != blank %}
+ "sku": {{ selected_variant.sku | json }},
{% endif %}
- {% if offer_variant.barcode != blank %}
- "mpn": {{ offer_variant.barcode | json }},
+ {% if selected_variant.barcode != blank %}
+ "mpn": {{ selected_variant.barcode | json }},
{% endif %}
"offers": {
"@type": "Offer",
"priceCurrency": {{ cart.currency.iso_code | json }},
- "price": {{ offer_variant.price | divided_by: 100.0 | json }},
- "availability": "http://schema.org/{% if offer_variant.available %}InStock{% else %}OutOfStock{% endif %}",
- "url": "{{ shop.url }}{{ offer_variant.url }}",
+ "price": {{ selected_variant.price | divided_by: 100.0 | json }},
+ "availability": "http://schema.org/{% if selected_variant.available %}InStock{% else %}OutOfStock{% endif %}",
+ "url": "{{ shop.url }}{{ selected_variant.url }}",
"seller": {
"@type": "Organization",
"name": {{ shop.name | json }}
← c692cedc TK-10661: normalize Sample match (downcase|strip) per codex
·
back to Dw Validator Debug TK11314
·
Kravet roll-add: repoint MAP price source to authoritative k 57ef8948 →