• Модуль: catalog
  • Путь к файлу: ~/bitrix/modules/catalog/lib/product/systemfield/markingcodegroup.php
  • Класс: BitrixCatalogProductSystemFieldMarkingCodeGroup
  • Вызов: MarkingCodeGroup::getParentProductValue
static function getParentProductValue(int $id, $field): ?string
{
	$result = null;
	$parentsList = CCatalogSku::getProductList($id);
	if (!empty($parentsList) && isset($parentsList[$id]))
	{
		$row = CatalogProductTable::getRow([
			'select' => [
				'ID',
				$field['FIELD_NAME'],
			],
			'filter' => [
				'=ID' => $parentsList[$id]['ID'],
			],
		]);
		if ($row !== null)
		{
			$result = $row[$field['FIELD_NAME']];
		}
	}

	return $result;
}