31 private bool $useFilter =
false;
36 parent::__construct($settings);
41 $this->useFilter = $value;
53 private function getIblockId(): int
60 $result = parent::getOrmFilter();
64 $result[
'IBLOCK_ID'] = $this->
getSettings()->getIblockId();
72 $columns = parent::prepareColumns();
74 return $this->prepareSortingColumns($columns);
77 private function getBasePriceColumnId(): string
79 return PriceProvider::getPriceTypeColumnId(
84 private function prepareDefaultColumns(Columns $columns): void
86 $defaultColumns = array_fill_keys([
92 $this->getBasePriceColumnId(),
95 foreach ($columns as $column)
97 $id = $column->getId();
99 isset($defaultColumns[$id])
109 private function prepareSortingColumns(array $columns): array
112 foreach ($columns as $column)
114 $map[$column->getId()] = $column;
124 $this->getBasePriceColumnId(),
129 foreach ($primaryColumns as $columnId)
131 if (isset($map[$columnId]))
133 $result[] = $map[$columnId];
134 unset($map[$columnId]);
138 array_push($result, ... array_values($map));
143 #region creation methods
149 $this->prepareDefaultColumns($columns);
162 $assembler->setUseCatalogTab(
163 Option::get(
'catalog',
'show_catalog_tab_with_offers') ===
'Y'
165 $assembler->setUseSkuSelector(
173 $this->getProductRightsChecker()
184 $this->getProductRightsChecker()
191 if (!$this->useFilter)
196 $settings = new \Bitrix\Catalog\Filter\DataProvider\Settings\ProductSettings([
197 'ID' => $this->
getId(),
198 'IBLOCK_ID' => $this->
getSettings()->getIblockId(),
199 'VARIATION_IBLOCK_ID' => $this->
getSettings()->getOffersIblockId(),
200 'LINK_PROPERTY_ID' => $this->
getSettings()->getSkuPropertyId(),
208 #endregion creation methods