It appears that last year Shopify has introduced a filter to create the JSON-LD.
{{ product | structured_data }}
However, this is fixed and not flexible. I need to modify the price as we have a minimum order quantity, everything else should remain as is.
Does someone have the liquid code to generate the JSON-LD so that I don’t have to start from scratch?
Maybe Shopify could document the necessary code or make it possible to adjust values while keeping the rest.
@kadajawi I can share one JSON-LD example below for your reference:
<html>
<head>
<title>Executive Anvil</title>
<script type="application/ld+json">
{
"@context": "https://schema.org/",
"@type": "Product",
"name": "Executive Anvil",
"image": [
"https://example.com/photos/1x1/photo.jpg",
"https://example.com/photos/4x3/photo.jpg",
"https://example.com/photos/16x9/photo.jpg"
],
"description": "Sleeker than ACME's Classic Anvil, the Executive Anvil is perfect for the business traveler looking for something to drop from a height.",
"sku": "0446310786",
"mpn": "925872",
"brand": {
"@type": "Brand",
"name": "ACME"
},
"review": {
"@type": "Review",
"reviewRating": {
"@type": "Rating",
"ratingValue": 4,
"bestRating": 5
},
"author": {
"@type": "Person",
"name": "Fred Benson"
}
},
"aggregateRating": {
"@type": "AggregateRating",
"ratingValue": 4.4,
"reviewCount": 89
},
"offers": {
"@type": "Offer",
"url": "https://example.com/anvil",
"priceCurrency": "USD",
"price": 119.99,
"priceValidUntil": "2024-11-20",
"itemCondition": "https://schema.org/UsedCondition",
"availability": "https://schema.org/InStock"
}
}
</script>
</head>
<body>
</body>
</html>
Actually, there exist one category listing the ways of adjusting values and modifying price in multiple ways in Google Developer Doc. You can read this article here I attach below for more details and I believe one of them is what you need. Merchant listing (Product, Offer) structured data