G
G
grinch_asd2019-02-15 21:50:41
1C-Bitrix
grinch_asd, 2019-02-15 21:50:41

Bitrix. Property values ​​of bound elements are not displayed?

Hello.
You need to display the properties of elements bound via "Binding to element". Code of the property to be displayed - NEW_PRICE

Made a result_modifier file
<?php if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true) die();

$arSelect = Array("ID", "NEW_PRICE"); 
$arFilter = Array("IBLOCK_ID"=>6, "ACTIVE"=>"Y","ID"=>$_GET["prices"]);

$res = CIBlockElement::GetList(array("SORT" => "ASC"), $arFilter, false, Array("nPageSize"=>PHP_INT_MAX), $arSelect);

$prices = array();
while($ob = $res->GetNextElement())
{
  $arFields = $ob->GetFields();
  $prices[] = $arFields;
}

$arResult["PRICE_Q"] = $prices;

?>

In news.detail::template wrote
<?if($arResult["PROPERTIES"]["PRICES"]["VALUE"] > 0){?>
  <h4 class="text-center">Цены</h4>
  <section class="bottommargin_30 row item-content ">					
    <div class="prom_beer_wrapper col-sm-12">
      <ul class="list1 no-bullets">
        <?foreach($arResult["PROPERTIES"]["PRICES"]["VALUE"] as $prices):?> 
          <?$res = CIBlockElement::GetByID($prices);?> 
          <?if($ar_res = $res->GetNext())?> 					
          <li class="content-justify"><?=$ar_res["NAME"];?>
          <?=$arResult["PRICE_Q"];?></li>
          <?endforeach;?>
      </ul>						
    </div>					
  </section>
<?}?>


The name is displayed. But instead of NEW_PRICE - Array. Tell me, please, what is the error?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question