diff --git a/app/code/Magento/CatalogInventory/Model/StockManagement.php b/app/code/Magento/CatalogInventory/Model/StockManagement.php index 4cdb1b298126d..06599446a9ea9 100644 --- a/app/code/Magento/CatalogInventory/Model/StockManagement.php +++ b/app/code/Magento/CatalogInventory/Model/StockManagement.php @@ -102,7 +102,7 @@ public function registerProductsSale($items, $websiteId = null) if (!$stockItem->hasAdminArea() && !$this->stockState->checkQty($productId, $orderedQty, $stockItem->getWebsiteId()) ) { - $this->getResource()->commit(); + $this->getResource()->rollBack(); throw new \Magento\Framework\Exception\LocalizedException( __('Not all of your products are available in the requested quantity.') ); @@ -180,7 +180,7 @@ protected function getProductType($productId) } /** - * @return Stock + * @return ResourceStock */ protected function getResource() {