B
B
Beeshop872021-08-06 18:02:19
1C-Bitrix
Beeshop87, 2021-08-06 18:02:19

Bitrix. How to get location name from order object?

I'm working with the shipment permission event "OnShipmentAllowDelivery".
I work with the shipping entity. I was able to get all the properties I needed. But there is a gag with getting the destination city.
There is a location in the admin panel in the order properties.
In the photo all the fields of the order. The very last line is the value of the "location" property.
I couldn't google how to get the name of the destination city from this code.
610d4e3b86faa520586035.png

Answer the question

In order to leave comments, you need to log in

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

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

$code = '0000028023';

$location = \Bitrix\Sale\Location\LocationTable::getByCode(
  $code,
  [
    'select' => ['LOCATION_NAME' => 'NAME.NAME']
  ]
)->fetch();

print_r($location);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question