Answer the question
In order to leave comments, you need to log in
How to get an array with Bitrix order information?
Good afternoon!
There was a need to redo the thankyou page (the “Thank you for the order” page) and add several fields that were absent by default, you need to add:
1. Full name.
2. Delivery address
Only D7 must be used!
I found two methods \Bitrix\Sale\Order::loadByFilter($parameters) and \Bitrix\Sale\Order::getList($parameters), but if I understand correctly, they will go through each order in the database until they find the necessary one, what is most likely to affect the performance and speed of the site or am I mistaken?
In short, tell me in which direction to dig and it is desirable that this does not affect the speed of the site.
On the thankyou page itself, it is possible to get ID and ACCOUNT_NUMBER
Answer the question
In order to leave comments, you need to log in
$arOrderProps = [];
$dbRes = \Bitrix\Sale\PropertyValue::getList([
'select' => ['CODE', 'VALUE'],
'filter' => ['=ORDER_ID' => 6, 'CODE' => ['FIO', 'PHONE']]
]);
while($arRes = $dbRes->fetch()) {
$arOrderProps[$arRes['CODE']] = $arRes['VALUE'];
}
print_r($arOrderProps);
Thanks for the tip.
1. I used both methods, and both give an array of data in which there is no information I need www.prnt.sc/s952ux
2. I use the methods in result_modifier.php and on the "Checkout" page the following behavior:
What thoughts?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question