A
A
Andrey Bely2020-05-01 12:11:59
1C-Bitrix
Andrey Bely, 2020-05-01 12:11:59

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

2 answer(s)
P
PetrPo, 2020-05-07
@just_guy95

$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);

Property codes and order id for the required replacements

A
Andrey Bely, 2020-05-01
@just_guy95

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:
5eabfeda9e1f1214188489.png
What thoughts?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question