Answer the question
In order to leave comments, you need to log in
How to get a list type value when updating an element?
When updating an element by its property, you need to add a section binding to it. I can't figure out how exactly to get the value of type "list"
AddEventHandler("iblock", "OnAfterIBlockElementUpdate",'AddSeoSection');
function AddSeoSection(&$arFields)
{
if ($arFields['PROPERTY_VALUES']['VALUE'] == 'настенный') { //пробую так
$db_old_groups = CIBlockElement::GetElementGroups($arFields['ID'], true);
$ar_new_groups = Array($NEW_GROUP_ID);
while($ar_group = $db_old_groups->Fetch())
$ar_new_groups[] = $ar_group["ID"];
array_push($ar_new_groups, '807');
CIBlockElement::SetElementSection($arFields['ID'], $ar_new_groups);
}
}
Answer the question
In order to leave comments, you need to log in
I did as suggested in the comments.
$db_props = CIBlockElement::GetProperty(32, $arFields['ID'], array("sort" => "asc"), Array("CODE"=>"TIP_USTANOVKI"));
if($ar_props = $db_props->Fetch())
$prop_val = $ar_props['VALUE'];
if($prop_val == 115419){...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question