How do I dynamically update the JSON-LD Script for the Schema

  ajax, html, javascript, jquery, php

I have the following script, my question is given after the script.

<script type="application/ld+json">

{
"@context": "http://schema.org/",
"@type": "Product",
"name": "Bat,

"aggregateRating": {
"@type": "AggregateRating",
"ratingValue": "4.9",
"ratingCount": "77"
},
"offers": {
"@type": "AggregateOffer",
"lowPrice": "5.76",
"highPrice": "8",
"availability": "http://schema.org/InStock",
"priceCurrency": "USD"
}
}

I want update ratingValue and ratingCount

Source: Ask PHP

LEAVE A COMMENT