foreach arElements as arElement propertyValues propertyEmptyValuesC om

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
foreach($arElements as $arElement){
$propertyValues = $propertyEmptyValuesCombination;
foreach($arResult['ITEMS'] as $PID => $arItem){
if(is_array($arElement[$PID])){
foreach($arElement[$PID] as $value){
$key = $this->fillItemValues($arResult["ITEMS"][$PID], $value);
$propertyValues[$PID][$key] = $arResult["ITEMS"][$PID]["VALUES"][$key]["VALUE"];
}
}
elseif ($arElement[$PID] !== false){
$key = $this->fillItemValues($arResult["ITEMS"][$PID], $arElement[$PID]);
$propertyValues[$PID][$key] = $arResult["ITEMS"][$PID]["VALUES"][$key]["VALUE"];
}
if($USER->GetId() == 2){
//dias($arElement);
if($PID == 168){
//Выборка характеристик элемента
$dbEl = CIBlockElement::GetList(
array(),
array(
'IBLOCK_TYPE' => $arParams['IBLOCK_TYPE'],
'IBLOCK_ID' => $arParams['IBLOCK_ID'],
'ID' => $arElement['IBLOCK_ELEMENT_ID']
)
);
$obEl = $dbEl->GetNextElement();
$props = $obEl->GetProperties(array('id' => 'ASC'), array('NAME' => 'Характеристики'));
foreach($arResult["ITEMS"][$PID]['VALUES'] as $propKey => &$propValue){
if(!array_key_exists('DESCRIPTION', $propValue)){
//Добавление описания к значению
foreach($props['CML2_ATTRIBUTES']['VALUE'] as $propKeyNumber => $propValueText){
if($propKey == $propValueText)
$propValue['DESCRIPTION'] = $props['CML2_ATTRIBUTES']['DESCRIPTION'][$propKeyNumber];
}
//dias($propKey);
//dias($propValue);
//Формирование массива для группировки значений характеристик
if(!array_search(trim($propValue['DESCRIPTION']), $propertiesGroup))
foreach($propertiesGroup as $pgv){
//$pgv
}
$propertiesGroup[] = trim($propValue['DESCRIPTION']);
}
}
//dias($arResult["ITEMS"][$PID]);
//dias($props);
}
}
}
$propertyValuesCombination = array();
$this->ArrayMultiply($propertyValuesCombination, $propertyValues);
foreach($propertyValuesCombination as $propertyValues)
$arResult["COMBO"][md5(serialize($propertyValues))] = $propertyValues;
}