Answer the question
In order to leave comments, you need to log in
How to display data from a custom field in Bitrix?
Hello. In the online store in the list of retail stores (warehouses) I want to add additional photos. I made a custom field UF_STOREPHOTO of the file type, the picture is loaded. But I ran into a problem with displaying this field on the page. I'm editing catalog.store.detail, but I can't get the data out of the custom field. Looked for various solutions, but none worked.
I also tried to make a new IMAGE_ID2 column directly in the database, by analogy with the existing IMAGE_ID, but it is also not picked up, although the standard IMAGE_ID works. As if you still need to manually specify that there is such an IMAGE_ID2 field in the database.
For example, I tried this:
<?
$rsResult = CIBlockSection::GetList(array("SORT" => "ASC"), array("IBLOCK_ID" => $arItems["IBLOCK_ID"], "ID" => $arItems["ID"]), false, $arSelect = array("UF_*"));
if($arSection = $rsResult->GetNext()) {
$UF_STOREPHOTO = $arSection["UF_STOREPHOTO"];
}
?>
<img src="<?=CFile::GetPath($UF_STOREPHOTO);?>" alt="" />
Answer the question
In order to leave comments, you need to log in
Custom properties are stored in an array.
<?foreach($arResult as $arItem) {
echo '<pre>';
print_r($arItem["PARAMS"]);
echo '</pre>';
}
?>
<?
echo $arItem['PARAMS']["Название пользовательского свойства"]
?>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question