- Модуль: sale
- Путь к файлу: ~/bitrix/modules/sale/lib/helpers/order/builder/basketbuilder.php
- Класс: BitrixSaleHelpersOrderBuilderBasketBuilder
- Вызов: BasketBuilder::obtainCatalogProductsData
protected function obtainCatalogProductsData(array $fields = array())
{
if(empty($this->catalogProductsIds))
return;
$order = $this->getOrder();
//$this->catalogProductsIds = array();
foreach($this->catalogProductsIds as $id)
{
$details = OrderEdit::getProductDetails($id, $order->getUserId(), $order->getSiteId());
if($details !== false)
$this->catalogProductsData[$id] = $details;
}
$noCachedProductIds = array_diff($this->catalogProductsIds, array_keys($this->catalogProductsData));
if(!empty($noCachedProductIds))
{
$noCachedData = BitrixSaleHelpersAdminProduct::getData($noCachedProductIds, $order->getSiteId(), array_keys($fields));
foreach($noCachedData as $productId => $productData)
{
$this->catalogProductsData[$productId] = $productData;
OrderEdit::setProductDetails($productId, $order->getUserId(), $order->getSiteId(), $this->catalogProductsData[$productId]);
}
$emptyData = array_diff($this->catalogProductsIds, array_keys($this->catalogProductsData));
foreach($emptyData as $productId)
$this->catalogProductsData[$productId] = array();
}
}