Answer the question
In order to leave comments, you need to log in
How to set the order payment flag in Bitrix D7?
Hello. How to correctly set the order payment flag in Bitrix via api? I use the following construction:
use Bitrix\Sale\Order;
$order = \Bitrix\Sale\Order::load(1478);
$paymentCollection = $order->getPaymentCollection();
foreach ($paymentCollection as $payment) {
if (!$payment->isPaid()) {
$payment->setPaid("Y");
}
}
$order->setField("STATUS_ID", "F"); // статус заказа - выполнен
$order->refreshData();
$order->save(); // сохранить заказ
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question