A
A
anriko2020-01-27 18:54:52
1C-Bitrix
anriko, 2020-01-27 18:54:52

How to write correctly in init php adding fields to FEEDBACK_FORM?

<?php
//Обработчик в файле /bitrix/php_interface/init.php
AddEventHandler("main", "OnBeforeEventAdd", array("AddCustomFields", "OnBeforeEventAddHandler"));
class AddCustomFields
{
function OnBeforeEventAddHandler(&$event, &$lid, &$arFields){
/*Добавление полей в письмо */
$arFields["NEW_FIELD"] =  Array(
                "PRODUCT_NAME" =>$_POST["product_name"],
                "FILE_NAME" => $_FILES['file']['name']
      );
/*Добавление макросов в письмо */			
$arFields["VS_BIRTHDAY"] = Array(
       "FILE_NAME" => $_POST["product_name"],
       "FILE_NAME" => $_FILES['file']['name'],
       );
$lid = 's2';
}
}
?>

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question