30 $propertyValues = self::getPropertyValues(
35 $skuPropertyValues = $propertyValues[$sku->
getId()] ?? [];
37 return self::getPropertyDisplayValues($skuPropertyValues);
51 $propertyValues = self::getPropertyValues(
56 $skuPropertyValues = $propertyValues[$sku->
getId()] ?? [];
60 foreach ($skuPropertyValues as $property)
68 $property[
'DISPLAY_VALUE'] = $displayValue;
70 $result[$property[
'CODE']] = $property;
81 private static function getPropertyValues($skuIblockId, array $skuIds): array
83 $propertyValues = array_fill_keys($skuIds, []);
85 \CIBlockElement::GetPropertyValuesArray(
89 [
'ID' => PropertyCatalogFeature::getOfferTreePropertyCodes($skuIblockId)]
92 return $propertyValues;
108 private static function getPropertyDisplayValues(array $properties): string
112 foreach ($properties as $property)
120 $result[] = $displayValue;
123 return implode(
', ', $result);
132 if (!empty($propertyValue[
'USER_TYPE']))
134 $userType = \CIBlockProperty::GetUserType($propertyValue[
'USER_TYPE']);
135 $searchMethod = $userType[
'GetSearchContent'] ??
null;
137 if ($searchMethod && is_callable($searchMethod))
139 $value = $searchMethod($propertyValue, [
'VALUE' => $propertyValue[
'~VALUE']], []);
148 $value = $propertyValue[
'~VALUE'] ??
'';
151 if (is_array($value))
153 $value = implode(
', ', $value);
156 $value = trim((
string)$value);