Skip to main content
32 votes

inventory_stock_1 doest exist on Magento 2.3

You need elevated permissions to use the CREATE ALGORITHM bit This can and will stop an import in it's tracks. Instead use this statement to create the view CREATE OR REPLACE VIEW `...
Dominic Pixie's user avatar
22 votes

Magento 2: Programmatically Updating Inventory

If you are using the @giel-berkers solution, you may need to set isInStock also, because it will not be automatically sets. So, the following code was useful for me: public function __construct( \...
spiilmusic's user avatar
16 votes
Accepted

inventory_stock_1 doest exist on Magento 2.3

I got the solution for this, you need to create a view table inventory_stock_1 for your catalog in database. Here is the command you need to run in your DB SQL. Make sure to update 3 things in below ...
Pankaj Sharma's user avatar
10 votes

How to get product stock status on the listing page in Magento 2?

You can try the following code public function __construct( \Magento\CatalogInventory\Api\StockRegistryInterface $stockRegistry ) { $this->stockRegistry = $stockRegistry; } // you can pass $...
Mohit Rane's user avatar
  • 1,964
9 votes

How to get product stock status on the listing page in Magento 2?

If you are using the only simple products in your system then using the Stock Status field check then Product status is Ok. But when you have a configurable or bundle or group product then it is not ...
Amit Bera's user avatar
  • 77.7k
8 votes

Magento 2: Programmatically Updating Inventory

One thing the other answers missed is that if you setQty($qty), it will apply the exact value you provide. But if a sale was made for that product a moment before your save, the original qty could ...
cyk's user avatar
  • 293
7 votes
Accepted

Magento 2 stock inventory is not being updated

Check below settings. Admin > Store > Configuration > Catalog > Inventory > Stock option > Decrease Stock When Order is Placed Set it to yes. If you have a multi-website or multi-store then change ...
Chirag Patel's user avatar
  • 6,166
7 votes
Accepted

Magento 2.3 Saleable stock qty does not equal Global Attribute Qty

Check inventory_reservation: https://github.com/magento-engcom/msi/wiki/Salable-Quantity-Calculation-and-Mechanism-of-Reservations If you don't want to use MSI (and stick to CatalogInventory_* from 2....
dudzio's user avatar
  • 620
7 votes
Accepted

Magento 2.3 inventory index gives The product that was requested doesn't exist. Verify the product and try again

Recently we experienced this very issue too. Solution in our case was making sure the inventory_source_item MySQL table does not contain any defunct SKU's. To lookup corrupted records in said table, ...
Ward's user avatar
  • 96
6 votes

Magento 2 stock inventory is not being updated

check your stock setting in admin panel Advance Inventory->manage stock set to yes if you want to reduce quantity
Tirth Patel's user avatar
  • 1,049
6 votes

Magento Inventory Reservation Compensation command not working

This command is waiting for you to tell it what compensation to create. See https://devdocs.magento.com/guides/v2.3/inventory/inventory-cli-reference.html for more detail, but generally, what you want ...
jay's user avatar
  • 453
6 votes
Accepted

"Only 0 Left" message has suddenly appeared after 2.4.2 upgrade

This is a bug affecting configurable products introduced by the new Magento_InventoryConfigurableProductFrontendUi module in Magento 2.4.2. You can read more about the issue here: https://github.com/...
paj's user avatar
  • 5,980
5 votes
Accepted

How is the qty loaded from database?

$products = Mage::getModel('catalog/product') ->getCollection() //->addAttributeToSelect('*') ->addAttributeToSelect(array('name', 'thumbnail', 'weight' ,'price','description')) ...
Ledian Hymetllari's user avatar
5 votes
Accepted

Magento-2 get all products having product qty less than 5 only

Try this: use Magento\Framework\App\Bootstrap; require DIR . '/../app/bootstrap.php'; $bootstrap = Bootstrap::create(BP, $_SERVER); $obj = $bootstrap->getObjectManager(); $state = $obj->get(...
kunj's user avatar
  • 3,709
5 votes

Can we clear inventory_reservation table. Magento2.3.1

In Magento 2, main quantity which you see in the qty field of the product might be different than salable quantity. Customers can buy buy products according to salable quantity only. Salable quantity ...
amitshree's user avatar
  • 7,076
4 votes

Magento 2: Programmatically Updating Inventory

$objectManager = $bootstrap->getObjectManager(); $stockRegistry = $objectManager->create('Magento\CatalogInventory\Api\StockRegistryInterface'); $stockItem = $stockRegistry->...
MHK Developer's user avatar
4 votes
Accepted

How can I get all email which are all under condition back in stock email alert?

When a customer clicks on Sign up to get notified when this product is back in stock, the customer id is saved in the product_alert_stock table. You can get the customer id using this model: $model =...
Vaibhav Ahalpara's user avatar
4 votes

Magento 2: Low Stock Notification Email to Admin

In magento direct email not sending to the admin. Magento show low stock report at Reports > Product > Low stock For Magento 2.2.x Admin Low Stock Notification email Free extension available in ...
Bharat Patel's user avatar
4 votes
Accepted

Show available inventory on configurable product magento 2

Finally I found a way to show awailable QTY: Override configurable.js: vendor/magento/module-configurable-product/view/frontend/web/js/configurable.js Add : jQuery('.myli').css('display','none')...
Ram Pratap Singh Gour's user avatar
4 votes

How to Track Inventory for Bulk Product

Potatoes sold as 5lb, 25lb or 100lb packages. Like you said set the actual product will be the one with the lowest weight. **(Potatoes 5lb)** This is qty = 1(or you can consider 1 qty = 1lb and ...
Aditya Shah's user avatar
  • 7,647
4 votes

Store level Inventory for individual product Magento 2.2.0

Untill magento 2.2.6 you can not assign / allocate inventory on store level or website level basis. inventory is managed globaly so you will have single inventory across all stores / websites. ...
Naveed Asim's user avatar
  • 3,667
4 votes

inventory_stock_1 doest exist on Magento 2.3

Find data patches name from patch_list table Magento\InventoryCatalog\Setup\Patch\Schema\CreateLegacyStockStatusView Delete or rename it. run upgrade command php bin/magento s:upg This issue may ...
Bhavesh Prajapati's user avatar
4 votes
Accepted

Magento 2 how to get Multi source inventory names website wise?

I did below as a solution: use Magento\Inventory\Model\ResourceModel\Source\Collection as InventoryCollection; use Magento\Framework\Api\SortOrderBuilder; use Magento\InventoryApi\Api\...
Utsav Gupta's user avatar
  • 1,243
4 votes

Disable stock check / decrease when shipping an order in Magento 2.3.1

~Update ~ Crim is correct. The solution is to disable Magento MSI completely. This is what I ended up doing in my case and works. You're not the only retailer with this issue. After spending some ...
MetalMonkey's user avatar
4 votes

How to get product stock status on the listing page in Magento 2?

Inject \Magento\CatalogInventory\Model\Stock\StockItemRepository $stockItemRepository, in constructor e.g: protected $_stockItemRepository; public function __construct( \Magento\...
Sameer Bhayani's user avatar
4 votes
Accepted

Salable quantity of 0 but still showing in stock?

I was facing the same issue in one of my projects recently. In my case the client wanted to display stock availability label (i.e. Instock/Outofstock) on category pages as well. That is not available ...
Pratik Navapara's user avatar
4 votes
Accepted

Magento2: Product Stock Bulk Update API

The endpoint you added in your post works properly for me :| I am not sure which is the problem on your environment, but I suggest you check the log files, surely there must be something in there. And ...
Diana's user avatar
  • 5,280
3 votes

Magento 2: Programmatically Updating Inventory

Magento2 also come up with Multi stock feature so to update on particular stock source you can follow this solution https://magento.stackexchange.com/questions/272296/how-to-set-qty-to-product-on-msi-...
Alam Zaib's user avatar
  • 199
3 votes
Accepted

How to update multiple rows of a table in a single query?

Your best bet is likely to use an insert query with the ON DUPLICATE KEY UPDATE command, like this: INSERT INTO `cataloginventory_stock_item` (item_id, qty, is_in_stock) VALUES (1, 1, 1), /*...
tjons's user avatar
  • 1,831
3 votes
Accepted

How Magento\CatalogInventory\Model\Stock\Item can be replaced in Constructor (DI)

protected $stockItemFactory; public function __construct( ... \Magento\CatalogInventory\Model\Stock\ItemFactory $stockItemFactory, .... ) { .... $this->stockItemFactory = $...
Marius's user avatar
  • 199k

Only top scored, non community-wiki answers of a minimum length are eligible