J
J
Jupiter Max2020-02-27 12:23:46
1C-Bitrix
Jupiter Max, 2020-02-27 12:23:46

How to solve the problem with unloading from 1s if the group structure changes?

The problem is this. If managers move groups in 1s, unloading from 1s does not work. What to do?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim, 2020-02-27
@Tomio

Catch the moment of unloading from 1C on the Bitrix side, in init.php, and replace the sections of the goods with the ones you need.

<? 
AddEventHandler("iblock", "OnBeforeIBlockElementUpdate","changeElementFieldsOnUpdateImport1C"); 
function changeIblockSectionsOnImportUpdate(&$arFields) 
{ 
    if ($_REQUEST['mode']=='import') 
    { 
        // тут смотрите $arFields товара и заменяете нужные значения
    } 
} 
AddEventHandler("iblock", "OnBeforeIBlockElementAdd","changeElementFieldsOnAddImport1C"); 
function changeElementFieldsOnAddImport1C(&$arFields) 
{ 
    if ($_REQUEST['mode']=='import') 
    { 
        // тут смотрите $arFields товара и заменяете нужные значения
    } 
} 
?>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question