AddEventHandler('sale', 'OnSaleComponentOrderShowAjaxAnswer', 'onSaleComponentOrderShowAjaxAnswerHandler');
function onSaleComponentOrderShowAjaxAnswerHandler (&$arResult, &$arParams) {
if ($_REQUEST['action'] == 'enterCoupon') {
file_put_contents($_SERVER['DOCUMENT_ROOT'] . '/scripts/filename.txt', print_r($arResult, true));
}
}
AddEventHandler("sale", "OnBeforeBasketUpdate", "addinside");
function addinside(&$arFields)
{
file_put_contents($_SERVER['DOCUMENT_ROOT'] . '/scripts/filename.txt', print_r($arFields, true));
}
Array
(
[0] => Array
(
[positionId] => 1
[name] => Товар 1
[quantity] => Array
(
[value] => 1
[measure] => шт
)
[itemAmount] => 50000
[itemCode] => 98806
[tax] => Array
(
[taxType] => 0
[taxSum] => 0
)
[itemPrice] => 50000
)
[1] => Array
(
[positionId] => 2
[name] => Товар 2
[quantity] => Array
(
[value] => 1
[measure] => шт
)
[itemAmount] => 50000
[itemCode] => 98806
[tax] => Array
(
[taxType] => 0
[taxSum] => 0
)
[itemPrice] => 50000
)
)
Array
(
[0] => Array
(
[0] => Array
(
[positionId] => 1
[name] => Товар 1
[quantity] => Array
(
[value] => 1
[measure] => шт
)
[itemAmount] => 50000
[itemCode] => 94231
[tax] => Array
(
[taxType] => 0
[taxSum] => 0
)
[itemPrice] => 50000
)
)
[1] => Array
(
[0] => Array
(
[positionId] => 2
[name] => Товар 2
[quantity] => Array
(
[value] => 1
[measure] => шт
)
[itemAmount] => 50000
[itemCode] => 98806
[tax] => Array
(
[taxType] => 0
[taxSum] => 0
)
[itemPrice] => 50000
)
)
)