1 Commits
Author SHA1 Message Date
soulchild 20bdf9d30d Use discounted price for JSON+LD structured data for product
Use discounted price for JSON+LD structured data for product
2026-07-10 08:58:13 +00:00
+10 -1
View File
@@ -746,8 +746,17 @@
endif
-%}
<!-- yagi product structured data -->
{% liquid
assign original_product_price_format = product.selected_or_first_available_variant.price | money_without_currency
assign discounted_product_price = product.selected_or_first_available_variant.metafields.app--168074346497.auto_discounted_price.value | default: product.selected_or_first_available_variant.price
assign discounted_product_price_format = discounted_product_price | money_without_currency
assign search_original_string = '"price":"' | append: original_product_price_format | append: '"'
assign search_replace_string = '"price":"' | append: discounted_product_price_format | append: '"'
%}
<script type="application/ld+json">
{{ product | structured_data }}
{{ product | structured_data | replace_first: search_original_string, search_replace_string }}
</script>
</div>
</product-component>