Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Magento 2.1.7 after add new product create only default stock #10

Open
rickyproge opened this issue Aug 9, 2017 · 1 comment
Open

Comments

@rickyproge
Copy link

rickyproge commented Aug 9, 2017

In Magento 2.1.7 after adding new product i can't create new entry in stock id.
It create only default stock qty and i can't add the others.

@rickyproge
Copy link
Author

Now I found how add Stocks per zone, but after set it i can't close checkout anymore.
After some debugging i found where error is generated:

  • Magento\Quote\Model\QuoteManagement -> placeOrder
  • checkout_submit_before event to Magento\CatalogInventory\Observer\SubtractQuoteInventoryObserver
$this->stockManagement->registerProductsSale(
    $items,
    $quote->getStore()->getWebsiteId()
);
  • Magento\CatalogInventory\Model\StockManagement in condition
 if (!$stockItem->hasAdminArea()
                && !$this->stockState->checkQty($productId, $orderedQty, $stockItem->getWebsiteId())
            ) {
                $this->getResource()->commit();
                throw new \Magento\Framework\Exception\LocalizedException(
                    __('Not all of your products are available in the requested quantity.')
                );
            }

the error is placed in condition $this->stockState->checkQty($productId, $orderedQty, $stockItem->getWebsiteId())

Please help

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant