56 private $stockRegistryStorage;
80 $this->qtyCounter = $qtyCounter;
81 $this->resource = $stockResource;
83 ->get(StockRegistryStorage::class);
99 $websiteId = $this->stockConfiguration->getDefaultScopeId();
103 $fullSaveItems = $registeredItems = [];
104 foreach ($lockedItems as $lockedItemRecord) {
113 if (!$canSubtractQty || !$this->stockConfiguration->isQty($lockedItemRecord[
'type_id'])) {
120 throw new \Magento\Framework\Exception\LocalizedException(
121 __(
'Not all of your products are available in the requested quantity.')
129 || $this->stockState->verifyNotification(
137 $this->qtyCounter->correctItemsQty($registeredItems,
$websiteId,
'-');
140 return $fullSaveItems;
151 $websiteId = $this->stockConfiguration->getDefaultScopeId();
168 $scopeId = $this->stockConfiguration->getDefaultScopeId();
175 if ($this->stockConfiguration->getCanBackInStock(
$stockItem->getStoreId()) &&
$stockItem->getQty()
179 $stockItem->setStockStatusChangedAutomaticallyFlag(
true);
194 return $this->productRepository->getById(
$productId)->getTypeId();
213 return $stockItem->getManageStock() && $this->stockConfiguration->canSubtractQty();
canSubtractQty(StockItemInterface $stockItem)
backItemQty($productId, $qty, $scopeId=null)
__construct(ResourceStock $stockResource, StockRegistryProviderInterface $stockRegistryProvider, StockState $stockState, StockConfigurationInterface $stockConfiguration, ProductRepositoryInterface $productRepository, QtyCounterInterface $qtyCounter, StockRegistryStorage $stockRegistryStorage=null)
registerProductsSale($items, $websiteId=null)
revertProductsSale($items, $websiteId=null)
getProductType($productId)