Что же там передает 1С во время обмена с Битрикс?

Есть множество вариантов отлавливания данных, но можно посмотреть их  в виде массива переменной arFields Битрикс во время обмена.

Добавляем в init.php код:

AddEventHandler("iblock", "OnBeforeIBlockElementUpdate",  "logdata");

function logdata(&$arFields)
{
    if (@$_REQUEST['mode']=='import')
    {
        file_put_contents($_SERVER["DOCUMENT_ROOT"]."/1clog.txt", "\n****************\n".print_r($arFields, true), FILE_APPEND | LOCK_EX);
        
    }
}

Прикольненько, теперь в файле 1clog.txt все видно!

****************
Array
(
[ACTIVE] => Y
[PROPERTY_VALUES] => Array
(
[2] => Array
(
[] => Array
(
[VALUE] =>
[DESCRIPTION] =>
)

)

[3] => Array
(
[] => Array
(
[VALUE] =>
[DESCRIPTION] =>
)

)

[46] => Array
(
[2055] => Array
(
[VALUE] => 20N5C1WM
[DESCRIPTION] =>
)

)

[4] => Array
(
[] => Array
(
[VALUE] =>
[DESCRIPTION] =>
)

)

[5] => Array
(
[2051] => Array
(
[VALUE] => company1
[DESCRIPTION] =>
)

[2066] => Array
(
[VALUE] => brand1
[DESCRIPTION] =>
)

)

[6] => Array
(
[] => Array
(
[VALUE] =>
[DESCRIPTION] =>
)

)

[7] => Array
(
[57628] => Array
(
[VALUE] => 2
[DESCRIPTION] =>
)

)

[8] => Array
(
[] => Array
(
[VALUE] =>
[DESCRIPTION] =>
)

)

[11] => Array
(
[2054] => Array
(
[VALUE] => Пластик
[DESCRIPTION] =>
)

)

[12] => Array
(
[] => Array
(
[VALUE] =>
[DESCRIPTION] =>
)

)

[14] => Array
(
[] => Array
(
[VALUE] =>
[DESCRIPTION] =>
)

)

[15] => Array
(
[] => Array
(
[VALUE] =>
[DESCRIPTION] =>
)

)

[16] => Array
(
[] => Array
(
[VALUE] =>
[DESCRIPTION] =>
)

)

[17] => Array
(
[2056] => Array
(
[VALUE] => 1
[DESCRIPTION] =>
)

)

[18] => Array
(
[] => Array
(
[VALUE] =>
[DESCRIPTION] =>
)

)

[47] => Array
(
[] => Array
(
[VALUE] =>
[DESCRIPTION] =>
)

)

[48] => Array
(
[] => Array
(
[VALUE] =>
[DESCRIPTION] =>
)

)

[49] => Array
(
[] => Array
(
[VALUE] =>
[DESCRIPTION] =>
)

)

[50] => Array
(
[n0] => Array
(
[VALUE] =>
[DESCRIPTION] =>
)

)

[51] => Array
(
[n0] => Array
(
[VALUE] => 4810344059260
[DESCRIPTION] =>
)

)

[52] => Array
(
[] => Array
(
[VALUE] =>
[DESCRIPTION] =>
)

)

[53] => Array
(
[n0] => Array
(
[VALUE] => Запас
[DESCRIPTION] => ВидНоменклатуры
)

[n1] => Array
(
[VALUE] => Товар
[DESCRIPTION] => ТипНоменклатуры
)

[n2] => Array
(
[VALUE] => 00-00030937
[DESCRIPTION] => Код
)

[n3] => Array
(
[VALUE] =>
[DESCRIPTION] => Планируемая дата поступления
)

)

[54] => Array
(
[n0] => Array
(
[VALUE] => шт
[DESCRIPTION] => 5
)

)

[55] => Array
(
[n0] => Array
(
[VALUE] => 0
[DESCRIPTION] => НДС
)

)

[58] => Array
(
[] => Array
(
[VALUE] =>
[DESCRIPTION] =>
)

)

[60] => Array
(
)

[20] => Array
(
[] => Array
(
[VALUE] =>
[DESCRIPTION] =>
)

)

[21] => Array
(
[] => Array
(
[VALUE] =>
[DESCRIPTION] =>
)

)

)

[TMP_ID] => AAAAAAAARno=1953
[XML_ID] => 317
[NAME] => Пирамидка «Колечко» (7 элементов)
[DETAIL_TEXT] => Яркая, занимательная игрушка поможет развить у вашего ребенка внимательность, усидчивость, терпение.<br>
А разноцветные колечки помогут выучить основные цвета.<br>
<br>
[DETAIL_TEXT_TYPE] => html
[DETAIL_PICTURE] => Array
(
[name] => piramidka-kolechko-7-elementov.jpg
[size] => 92800
[tmp_name] => /upload/1c_catalog/import_files/2f/2fa511c7-736a-11e7-87fc-d050991ab377_f93b1a25-a67a-11e7-8e65-d050991ab377.jpg
[type] => image/jpeg
[external_id] => 65edbebc06221fc591795ca416912ac4
[COPY_FILE] => Y
[description] => Картинка с сайта
[MODULE_ID] => iblock
[old_file] => 3932
)

[IBLOCK_SECTION] => Array
(
[0] => 16
)

[IBLOCK_SECTION_ID] => 16
[PREVIEW_TEXT] => Пирамидка «Колечко» (7 элементов)
[PREVIEW_TEXT_TYPE] => text
[MODIFIED_BY] => 1
[WF] => N
[WF_NEW] =>
[SEARCHABLE_CONTENT] => ПИРАМИДКА «КОЛЕЧКО» (7 ЭЛЕМЕНТОВ)
ПИРАМИДКА «КОЛЕЧКО» (7 ЭЛЕМЕНТОВ)
ЯРКАЯ, ЗАНИМАТЕЛЬНАЯ ИГРУШКА ПОМОЖЕТ РАЗВИТЬ
У ВАШЕГО РЕБЕНКА ВНИМАТЕЛЬНОСТЬ, УСИДЧИВОСТЬ,
ТЕРПЕНИЕ.
А РАЗНОЦВЕТНЫЕ КОЛЕЧКИ ПОМОГУТ ВЫУЧИТЬ
ОСНОВНЫЕ ЦВЕТА.
[IBLOCK_ID] => 2
[ID] => 317
)

 

 

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *