function yourHandler($WEB_FORM_ID, $RESULT_ID)
{
if ($WEB_FORM_ID == YOUR_NUMBER) // номер той формы, которую вы хотите поймать
{
$fields = array();
$arAnswers = CFormResult::GetDataByID($RESULT_ID, $fields);
// отправленные в форме данные в $arAnswers, можно что-то с ними сделать
}
}
AddEventHandler('form', 'onAfterResultAdd', 'yourHandler');
AddEventHandler('form', 'onAfterResultUpdate', 'yourHandler');
$service = \Bitrix\Sale\Delivery\Services\Manager::getById($deliveryId);
$deliveryData = [
'DELIVERY_ID' => $service['ID'],
'DELIVERY_NAME' => $service['NAME'],
'ALLOW_DELIVERY' => 'Y',
'PRICE_DELIVERY' => $deliveryPrice,
'CUSTOM_PRICE_DELIVERY' => 'Y'
];
$shipment->setFields($deliveryData);
window.myObject = {
urls: ['http://site1.com', 'http://site2.com'],
sum: '',
indx: 0,
add: function(str) {
this.sum += str;
if(++this.indx < this.urls.length) {
this.run();
} else {
alert('Result is ' + this.sum);
}
},
run: function() {
let xhr = new XMLHttpRequest();
xhr.open('GET', this.urls[this.indx]);
xhr.send();
xhr.onload = function() { window.myObject.add(xhr.result[0]); }
}
};
window.myObject.run();
Они же вроде дорабатывали десятку и по идее она должны быть лучше.