Answer the question
In order to leave comments, you need to log in
How to load the parameter created in the Bitrix template into the infoblock?
There is a multiple infoblock row property with rating values, I display the average value in the template.
<?php $ratingVals = $arItem["PROPERTIES"]["rating"]["VALUE"];
$count = count($ratingVals);
$median = round (array_sum($ratingVals) / $count, 2); ?>
<?=$median?>
CModule::IncludeModule('iblock');
$IBLOCK_ID = 48;
$getProperty = CIBlockElement::GetList (
Array("ID" => "ASC"),
Array("IBLOCK_ID" => $IBLOCK_ID, "ID" => $arFields['ID']),
false,
false,
Array(
'Property_median'
)
);
while($ar_fields = $getProperty->GetNext())
{
$setProperty= $ar_fields['vote_sum'];
}
CIBlockElement::SetPropertyValuesEx (
$arFields['ID'],$arFields['IBLOCK_ID'],array (
'vote_sum' => $setProperty
)
);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question