Hello, tell me the function of which you can change the payment flag to "paid." I try to do the following, if the order amount is equal to or less than 0, then the order is "PAID".
in the file bitrix / php_interface / s1 / init.php I write
<?php AddEventHandler('sale',"OnOrderUpdate" , 'PayedIfNoEMoney'); function PayedIfNoEMoney( $orderId , $arFields='' , $arOrder='' ) { if($arFields["PRICE"] <= 0){ CSaleOrder::StatusOrder($orderId, 'Y'); CSaleOrder::PayOrder($ID, "Y"); } } ?> but only the payment status changes, and the flag remains "unpaid"
