• Модуль: sale
  • Путь к файлу: ~/bitrix/modules/sale/lib/helpers/admin/product.php
  • Класс: BitrixSaleHelpersAdminProduct
  • Вызов: Product::fillCatalogData
private function fillCatalogData()
{
	$this->catalogData = [];
	$this->measuresIds = [];

	if (empty($this->iblockData))
	{
		return;
	}

	$setIds = [];

	$res = CatalogProductTable::getList([
		'select' => [
			'ID', 'TYPE',
			'AVAILABLE', 'QUANTITY', 'QUANTITY_TRACE', 'CAN_BUY_ZERO',
			'WEIGHT', 'WIDTH', 'LENGTH', 'HEIGHT',
			'MEASURE', 'BARCODE_MULTI', 'VAT_ID'
		],
		'filter' => ['@ID' => array_keys($this->iblockData)]
	]);
	while ($row = $res->fetch())
	{
		$this->catalogData[$row['ID']] = $row;
		$this->measuresIds[] = $row['MEASURE'];

		$type = (int)$row['TYPE'];
		if($type === CatalogProductTable::TYPE_SET)
		{
			$setIds[] = $row['ID'];
		}

		if (isset($this->resultData[$row['ID']]))
		{
			$this->resultData[$row['ID']]['TYPE'] = SaleInternalsCatalogProductTypeMapper::getType($type);
			$this->resultData[$row['ID']]['DIMENSIONS'] = serialize(
				[
					"WIDTH" => $row["WIDTH"],
					"HEIGHT" => $row["HEIGHT"],
					"LENGTH" => $row["LENGTH"]
				]
			);

			$this->resultData[$row['ID']]['AVAILABLE'] = (float)$row["QUANTITY"];
			$this->resultData[$row['ID']]['WEIGHT'] = $row["WEIGHT"];
			$this->resultData[$row['ID']]['BARCODE_MULTI'] = $row["BARCODE_MULTI"];
			$this->resultData[$row['ID']]["SET_ITEMS"] = [];
			$this->resultData[$row['ID']]["IS_SET_ITEM"] = "N";
			$this->resultData[$row['ID']]["VAT_ID"] = $row["VAT_ID"];
			$this->resultData[$row['ID']]["IS_SET_PARENT"] = "N"; //empty($arSetInfo) ? "N" : "Y";
		}
	}

	if (!empty($setIds))
	{
		$this->fillSetInfo($setIds);
	}
}