Answer the question
In order to leave comments, you need to log in
1C-Bitrix. How to get warehouse name by warehouse ID?
Good afternoon.
Can you please tell me how to get the name of the warehouse by the ID of the warehouse?
I get the warehouse ID (storeid) for the order:
use Bitrix\Sale;
$orderId = 68;
$saleOrder = Bitrix\Sale\Order::load($orderId);
$shipmentCollection = $saleOrder->getShipmentCollection();
foreach ($shipmentCollection as $shipment)
{
if (!$shipment->isSystem())
{
$arResult['originalDeliveryId'] = $shipment->getDeliveryId();
$arResult['customPriceDelivery'] = $shipment->getField('CUSTOM_PRICE_DELIVERY');
$arResult['basePrice'] = $shipment->getField('BASE_PRICE_DELIVERY');
$arResult['store_id'] = $shipment->getStoreId();
break;
}
}
Answer the question
In order to leave comments, you need to log in
Probably the easiest way is to include the Catalog module and use the corresponding DataMapper:
use \Bitrix\Catalog;
$arStore = Catalog\StoreTable::getRow([
'select' => ['TITLE'],
'filter' => [
'ID' => $iStoreId,
]
]);
if ( $arStore )
{
// В $arStore['TITLE'] название
}
else
{
// Склад не найден
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question