"https://schema.org/",
"@id" => $id,
"@type" => "Product",
"brand" => [
"@type" => "Brand",
"name" => "Nachhilfe-Team.net"
],
"sku" => "ntn-sku-" . get_the_ID(),
"mpn" => "ntn-mpn-" . get_the_ID(),
"description" => $description,
"name" => $name,
"image" => $image,
"offers" => [
"@type" => "Offer",
"availability" => "https://schema.org/InStock",
"price" => floatval($price),
"priceValidUntil" => $priceValidUntil,
"priceCurrency" => $priceCurrency,
"url" => $id
],
"review" => [
"@type" => "Review",
"reviewRating" => [
"@type" => "Rating",
"ratingValue" => 4.9,
"bestRating" => 5
],
"author" => [
"@type" => "Person",
"name" => "Frank Olschewski"
]
],
"aggregateRating" => [
"@type" => "AggregateRating",
"ratingValue" => floatval($ratingValue),
"bestRating" => 5,
"ratingCount" => intval($ratingCount)
]
];
// Hier kommt die saubere Ausgabe im Heredoc-Format:
$json = json_encode($structuredData, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
echo <<
$json
EOT;
?>