• Модуль: catalog
  • Путь к файлу: ~/bitrix/modules/catalog/lib/subscribe.php
  • Класс: BitrixCatalogSubscribeTable
  • Вызов: SubscribeTable::checkOldProductAvailable
static function checkOldProductAvailable($productId, $fields)
{
	$productId = (int)$productId;
	if ($productId <= 0 || (empty(static::$oldProductAvailable[$productId]))
		|| !static::checkPermissionSubscribe($fields['SUBSCRIBE']))
	{
		return false;
	}

	if(static::$oldProductAvailable[$productId]['AVAILABLE'] == ProductTable::STATUS_NO
		&& $fields['AVAILABLE'] == ProductTable::STATUS_YES)
	{
		static::runAgentToSendNotice($productId);
	}
	elseif(static::$oldProductAvailable[$productId]['AVAILABLE'] == ProductTable::STATUS_YES
		&& $fields['AVAILABLE'] == ProductTable::STATUS_NO)
	{
		static::runAgentToSendRepeatedNotice($productId);
	}

	unset(static::$oldProductAvailable[$productId]);

	return true;
}