20 $controllers = parent::getControllers();
24 'name' =>
'IBLOCK_SECTION_CONTROLLER',
25 'type' =>
'iblock_section',
35 'name' =>
'VARIATION_GRID_CONTROLLER',
36 'type' =>
'variation_grid',
47 $config = parent::collectFieldConfigs();
57 'name' =>
'variation_grid',
58 'title' =>
'Variation grid',
59 'type' =>
'included_area',
61 'isRemovable' =>
false,
62 'type' =>
'component',
64 'action' =>
'getProductGrid',
66 'signedParametersName' =>
'VARIATION_GRID_SIGNED_PARAMETERS',
74 return 'catalog.productcard.variation.grid';
85 'IBLOCK_ID' => $this->entity->getIblockId(),
86 'PRODUCT_ID' => $this->entity->getId(),
87 'COPY_PRODUCT_ID' => $this->params[
'COPY_PRODUCT_ID'] ??
null,
88 'EXTERNAL_FIELDS' => $this->params[
'EXTERNAL_FIELDS'] ??
null,
89 'PATH_TO' => $this->params[
'PATH_TO'] ?? [],
109 parent::buildDescriptions(),
110 $this->getSectionDescriptions(),
124 [
'name' =>
'IBLOCK_SECTION'],
126 parent::getPropertiesConfigElements()
130 private function getSectionDescriptions(): array
134 'entity' =>
'section',
135 'name' =>
'IBLOCK_SECTION',
137 'type' =>
'iblock_section',
140 'defaultValue' =>
null,
147 return $this->entity->isSimple();
152 if ($field[
'entity'] ===
'section')
154 return $this->getIblockSectionFieldValue();
157 return parent::getFieldValue($field);
160 private function getIblockSectionFieldValue(): array
162 $sectionIds = $this->entity->getSectionCollection()->getValues();
164 if (empty($sectionIds))
174 $additionalValues = parent::getAdditionalValues($values,
$descriptions);
176 $additionalValues[
'IBLOCK_SECTION_DATA'] = $this->getIblockSectionServiceFieldValue($values);
179 return $additionalValues;
182 private function getIblockSectionServiceFieldValue(array $values): array
186 $sections = $values[
'IBLOCK_SECTION'] ?? [];
187 $sections = array_diff($sections, [0]);
189 if (!empty($sections))
191 $sectionList = \CIBlockSection::GetList(
195 [
'ID',
'NAME',
'PICTURE']
197 while ($section = $sectionList->Fetch())
199 $picture = \CFile::resizeImageGet(
201 [
'width' => 100,
'height' => 100],
202 BX_RESIZE_IMAGE_EXACT,
205 $section[
'PICTURE'] = $picture[
'src'] ??
null;
206 $sectionData[] = $section;
static signParameters($componentName, $parameters)
static getMessage($code, $replace=null, $language=null)