Answer the question
In order to leave comments, you need to log in
How to create a form for adding elements to an infoblock using the Bitrix API?
It is necessary to add the "order in 1 click" button, which calls the form with the "phone" field, the result of the work of the form is to add an element to the new "quick orders" iblock.
That is, you need to make a regular form, in which there will be a field for the phone, a name and a hidden field with the name of the product.
Make a separate Infoblock in Bitrix called "Order in 1 click".
In the form handler, you need to programmatically create elements in the infoblock in which to write the Name, Phone and Product Name.
Answer the question
In order to leave comments, you need to log in
use the Add
method
1. Create an infoblock
2. Enter the required fields into the array in the handler (from the infoblock)
$el = new CIBlockElement; // подключаем класс для работы с инфоблоками
$iblock_id = 2; // тут id вашего инфоблока
$arFieldsSec = array(
'IBLOCK_ID'=>$iblock_id, // id инфоблока
'NAME' => $name // тут к примеру POST переменная name. NAME это название поля в инфоблоке
);
// ну и добавляем через метод
$el->Add($arFieldsSec);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question