77 BasketTable::getList([
82 'filter' => $basketItemFilter,
87 $basket2productIds = array_column($basketItems,
'PRODUCT_ID',
'ID');
88 if (empty($basket2productIds))
95 $rows = StoreProductTable::getList([
102 '=PRODUCT_ID' => $basket2productIds,
105 foreach ($rows as $row)
107 $calculator->setStoreQuantity($row[
'STORE_ID'], $row[
'PRODUCT_ID'], $row[
'AMOUNT']);
114 'STORE_ID' =>
'RESERVATION.STORE_ID',
115 'BASKET_ID' =>
'RESERVATION.BASKET_ID',
116 'PRODUCT_ID' =>
'RESERVATION.BASKET.PRODUCT_ID',
119 '!RESERVATION.STORE_ID' =>
null,
120 '=RESERVATION.BASKET.PRODUCT_ID' => $basket2productIds,
123 'DATE_RESERVE' =>
'ASC',
127 foreach ($reservationsRows as $row)
129 $calculator->addReservationHistory(
137 return $calculator->getQuantityForBatch($basket2productIds);
180 $basketItem = BasketTable::getRow([
188 if (!$basketItem || !$basketItem[
'PRODUCT_ID'])
193 $productId = (int)$basketItem[
'PRODUCT_ID'];
194 $storeQuantityRow = StoreProductTable::getRow([
199 '=STORE_ID' => $storeId,
200 '=PRODUCT_ID' => $productId,
203 if (!$storeQuantityRow)
209 $calculator->setStoreQuantity($storeId, $productId, $storeQuantityRow[
'AMOUNT']);
215 'BASKET_ID' =>
'RESERVATION.BASKET_ID',
218 '=RESERVATION.STORE_ID' => $storeId,
219 '=RESERVATION.BASKET.PRODUCT_ID' => $productId,
222 'DATE_RESERVE' =>
'ASC',
225 foreach ($reservationsRows as $row)
227 $calculator->addReservationHistory(
235 return $calculator->getQuantityForItem($productId, $basketId, $storeId);