• Модуль: catalog
  • Путь к файлу: ~/bitrix/modules/catalog/lib/compatible/eventcompatibility.php
  • Класс: BitrixCatalogCompatibleEventCompatibility
  • Вызов: EventCompatibility::handlerPriceOnAfterAdd
static function handlerPriceOnAfterAdd(CatalogModelEvent $event)
{
	$result = new CatalogModelEventResult();
	if (!self::allowedEvents())
		return $result;

	$success = $event->getParameter('success');
	if (!$success)
		return $result;

	self::disableEvents();

	$handlerList = array_merge(
		self::getHandlerList('catalog', self::EVENT_ON_PRICE_ADD),
		self::getHandlerList('sale', self::EVENT_ON_PRICE_ADD)       // compatibility with old strange code
	);
	if (!empty($handlerList))
	{
		$fields = $event->getParameter('fields');
		$actions = $event->getParameter('actions');
		$fields['RECALL'] = (isset($actions['OLD_RECOUNT']) && $actions['OLD_RECOUNT'] === true);
		$data = [
			$event->getParameter('id'),
			$fields + $event->getParameter('external_fields')
		];
		unset($actions, $fields);

		foreach ($handlerList as $handler)
		{
			ExecuteModuleEventEx($handler, $data);
		}
		unset($handler, $data);
	}
	unset($handlerList);

	self::enableEvents();

	return $result;
}