• Модуль: sale
  • Путь к файлу: ~/bitrix/modules/sale/lib/helpers/admin/product.php
  • Класс: BitrixSaleHelpersAdminProduct
  • Вызов: Product::completeResultData
private function completeResultData()
{
	if(empty($this->resultData))
		return;

	foreach($this->resultData as $productId => $productData)
	{
		$this->resultData[$productId]['PROPERTIES'] = array();
		$this->resultData[$productId]['PICTURE_URL'] = $this->createImageUrl($productId);
		$this->resultData[$productId]['MODULE'] = "catalog";
		$this->resultData[$productId]["PRODUCT_PROVIDER_CLASS"] = 'BitrixCatalogProductCatalogProvider';
		$this->resultData[$productId]["STORES"] = $this->getStoresData($productId);

		if($this->isOffer($productData) && !empty($this->iblockData[$productData['PRODUCT_ID']]))
		{
			$parentData = $this->iblockData[$productData['PRODUCT_ID']];

			if(is_array($parentData['PRODUCT_PROPS_VALUES']))
			{
				foreach($parentData['PRODUCT_PROPS_VALUES'] as $fieldId => $fieldValue)
				{
					if(!isset($productData['PRODUCT_PROPS_VALUES'][$fieldId])
					|| (isset($productData['PRODUCT_PROPS_VALUES'][$fieldId]) && is_null($productData['PRODUCT_PROPS_VALUES'][$fieldId]))
					)
					{
						$this->resultData[$productId]["PRODUCT_PROPS_VALUES"][$fieldId] = $fieldValue;
					}
				}
			}

			if(mb_strpos($this->iblockData[$productId]["XML_ID"], '#') === false)
			{
				$parentXmlId = strval($parentData['XML_ID']);
				$this->resultData[$productId]['PRODUCT_XML_ID'] = $parentXmlId.'#'.$this->iblockData[$productId]['XML_ID'];
			}
		}

		if(is_array($this->resultData[$productId]['PRODUCT_PROPS_VALUES']))
		{
			foreach($this->resultData[$productId]['PRODUCT_PROPS_VALUES'] as $fieldId => $fieldValue)
			{
				if(is_null($fieldValue))
				{
					$this->resultData[$productId]['PRODUCT_PROPS_VALUES'][$fieldId] = ' ';
				}
			}
		}
	}

	$this->fillPropsData();
	$this->fillMeasures();
	$this->fillMeasuresRatio();
}