B
B
bichukov2021-12-07 11:32:53
1C-Bitrix
bichukov, 2021-12-07 11:32:53

How to assign a property value to an element field?

There is this part of the code
foreach($arResult['OFFERS'] as $arOffer)
{
if($arOffer["DETAIL_TEXT"])
{
$arResult['DISPLAY_PROPERTIES_OFFERS'] = true;
break;
}
if($GLOBALS['USER']->isAdmin()):
if (isset($arOffer["DETAIL_TEXT"])){
echo 1;
$arOffer["DETAIL_TEXT"]=$arResult['PROPERTIES']['TEX_HARA']['VALUE'];
}
endif;
}
In which it is checked whether there is a detailed text field, and if so, it is considered a trade offer.
Next, it is checked whether there are empty fields in the detailed text of each TP. and if it finds it, outputs 1.
It all works, but here is the line $arOffer["DETAIL_TEXT"]=$arResult['PROPERTIES']['TEX_HARA']['VALUE']; until you can get it to work.
Can you please tell me if I'm doing something wrong?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Artem Zhitnik, 2021-12-07
@art-zhitnik

foreach ($arResult['OFFERS'] as &$arOffer) {
   ...
}

B
bichukov, 2021-12-07
@bichukov


Artem Zhitnik @art-zhitnik edit my header?
foreach($arResult['OFFERS'] as $arOffer)
{

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question