P
P
Prog-Time2021-06-01 12:29:20
1C-Bitrix
Prog-Time, 2021-06-01 12:29:20

How to Get data from Order Parameters tab?

I need to create a checkout event handler. Which I will write in init.php. In it, I will receive the last created order and check the value of the "Order source" property.

How can I get this property?

60b5fd68854dc261138730.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
PetrPo, 2021-06-01
@PetrPo

\Bitrix\Main\Loader::includeModule('sale');

$orderId = 1;

$dbRes = \Bitrix\Sale\Internals\OrderTable::getList(array(
  'filter' => array(
    'ORDER_ID' => $orderId
  ),
  'select' => array('SOURCE_NAME' => 'TRADING_PLATFORM.NAME')
));

if($tpOrder = $dbRes->fetch())
  $sourceName = $tpOrder['SOURCE_NAME'];

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question