Answer the question
In order to leave comments, you need to log in
How to track a change in a product property in 1C-Bitrix?
The product has a property (checkbox), and it is not clear how it works. I remove the checkbox, save it, but it does not go away.
There is nothing in the init.php file.
How can you track. what event and function change it before saving?
Answer the question
In order to leave comments, you need to log in
Found. In the init.php file, you need to add the following function to the "OnIBlockElementSetPropertyValuesEx" event:
\Bitrix\Main\EventManager::getInstance()->addEventHandler('iblock', 'OnIBlockElementSetPropertyValuesEx',"OnIBlockElementSetPropertyValuesExHandler");
function OnIBlockElementSetPropertyValuesExHandler($ELEMENT_ID, $IBLOCK_ID, $PROPERTY_VALUES, $propertyList, $arDBProps) {
define("LOG_FILENAME", $_SERVER["DOCUMENT_ROOT"] . "/log-prop.txt");
AddMessage2Log(print_r($PROPERTY_VALUES, 1));
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question