• Модуль: sale
  • Путь к файлу: ~/bitrix/modules/sale/lib/helpers/admin/product.php
  • Класс: BitrixSaleHelpersAdminProduct
  • Вызов: Product::getImageId
private function getImageId(array $product): int
{
	$fieldImage = 0;
	if (isset($product['PREVIEW_PICTURE']) && (int)$product['PREVIEW_PICTURE'] > 0)
	{
		$fieldImage = (int)$product['PREVIEW_PICTURE'];
	}
	elseif (isset($product['DETAIL_PICTURE']) && (int)$product['DETAIL_PICTURE'] > 0)
	{
		$fieldImage = (int)$product['DETAIL_PICTURE'];
	}

	$propertyImage = 0;
	if (isset($product['PROPERTY_MORE_PHOTO_VALUE']) && (int)$product['PROPERTY_MORE_PHOTO_VALUE'] > 0)
	{
		$propertyImage = (int)$product['PROPERTY_MORE_PHOTO_VALUE'];
	}

	if ($this->useSliderCard)
	{
		$result = ($propertyImage > 0 ? $propertyImage : $fieldImage);
	}
	else
	{
		$result = ($fieldImage > 0 ? $fieldImage : $propertyImage);
	}
	unset($propertyImage, $fieldImage);

	return $result;
}