• Модуль: catalog
  • Путь к файлу: ~/bitrix/modules/catalog/lib/grid/panel/productgroupaction.php
  • Класс: BitrixCatalogGridPanelProductGroupAction
  • Вызов: ProductGroupAction::actionConvertProductToServicePanel
protected function actionConvertProductToServicePanel(array $params = []): ?array
{
	if (!$this->isAllowedProductActions())
	{
		return null;
	}
	if (!$this->isUiGrid())
	{
		return null;
	}

	$params['APPLY_BUTTON_ID'] = 'convert_product_to_service_confirm';
	$params['CONFIRM_MESSAGE'] =
		CatalogConfigState::isUsedInventoryManagement()
			? Loc::getMessage('IBLOCK_GRID_PANEL_ACTION_CONVERT_PRODUCT_TO_SERVICE_CONFIRM_WITH_INVENTORY')
			: Loc::getMessage('IBLOCK_GRID_PANEL_ACTION_CONVERT_PRODUCT_TO_SERVICE_CONFIRM_WITHOUT_INVENTORY')
	;

	return [
		'name' => (string)($params['NAME'] ?? Loc::getMessage('IBLOCK_GRID_PANEL_ACTION_CONVERT_PRODUCT_TO_SERVICE')),
		'type' => 'multicontrol',
		'action' => [
			[
				'ACTION' => MainGridPanelActions::RESET_CONTROLS
			],
			[
				'ACTION' => MainGridPanelActions::CREATE,
				'DATA' => [$this->getApplyButtonWithConfirm($params)]
			]
		]
	];
}