• Модуль: catalog
  • Путь к файлу: ~/bitrix/modules/catalog/lib/product/sku.php
  • Класс: BitrixCatalogProductSku
  • Вызов: Sku::calculateComplete
static function calculateComplete($id, $iblockId = null, $type = null)
{
	if (!self::allowedUpdateAvailable())
		return;

	$id = (int)$id;
	if ($id <= 0)
		return;

	if (
		$type == CatalogProductTable::TYPE_FREE_OFFER
		|| ($type == CatalogProductTable::TYPE_PRODUCT && !self::isSeparateSkuMode())
		|| $type == CatalogProductTable::TYPE_SET
	)
		return;

	if ($iblockId !== null)
	{
		$iblockId = (int)$iblockId;
		if ($iblockId <= 0)
			$iblockId = null;
	}

	switch ($type)
	{
		case CatalogProductTable::TYPE_SKU:
		case CatalogProductTable::TYPE_EMPTY_SKU:
			self::setCalculateData(self::$deferredSku, $id, $iblockId);
			break;
		case CatalogProductTable::TYPE_OFFER:
			self::setCalculateData(self::$deferredOffers, $id, $iblockId);
			break;
		default:
			if (isset(self::$deferredSku[$id]))
				self::setCalculateData(self::$deferredSku, $id, $iblockId);
			elseif (isset(self::$deferredOffers[$id]))
				self::setCalculateData(self::$deferredOffers, $id, $iblockId);
			else
				self::setCalculateData(self::$deferredUnknown, $id, $iblockId);
			break;
	}
	if (!self::usedDeferredCalculation())
		self::calculate();
}