Use discounted price for JSON+LD structured data for product
Use discounted price for JSON+LD structured data for product
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user