Форматирование результат json в php
Пытаюсь сделать микроразметку, столкнулся с проблемой
$arResult['JSON'] = array(
'@context' => "http://schema.org/",
'@type' => 'Product',
'name' => $arResult['NAME'],
'aggregateRating' => array(
'@type' => 'AggregateRating',
'ratingValue' => ($rating['value']==0) ? 5 : $rating['value'],
'reviewCount' => $rating['cnt'],
),
'offers' => array(
'@type' => 'AggregateOffer',
'lowPrice' => $price['MIN'],
'highPrice' => $price['MAX'],
'priceCurrency' => 'ГРН'
)
);
$this->__component->arResultCacheKeys = array_merge($this->__component->arResultCacheKeys,array('JSON'));
Вывожу
$asset = Bitrix\Main\Page\Asset::getInstance();
if(!empty($arResult['JSON'])){
$asset->addString('<script type="application/ld+json" type="application/ld+json">'.json_encode($arResult['JSON']).'</script>');
}
Но на выходы не показывает нормально, вместо name не отформатированные данные, как мне вывести нормальные данные?*
<script type="application/ld+json" type="application/ld+json">{"@context":"http:\/\/schema.org\/","@type":"Product","name":"\u0410\u043a\u0443\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u044b","aggregateRating":{"@type":"AggregateRating","ratingValue":5,"reviewCount":1},"offers":{"@type":"AggregateOffer","lowPrice":135.882,"highPrice":1222.938,"priceCurrency":"\u0413\u0420\u041d"}}</script>