cancel
Showing results for 
Search instead for 
Did you mean: 

Magento 2 Undefined Index: Quantity -> Disabled Products

Magento 2 Undefined Index: Quantity -> Disabled Products

Hello,

I'm not sure if anyone can help? I've been trying to solve this problem for some time and I've narrowed it down.

 

I am currently having a problem when disabling a product in Magento 2.
When I disable a product I get the following error

 

Notice: Undefined index: quantity in /home/customer/www/domain.co.uk/public_html/vendor/magento/module-inventory-sales/Model/GetProductSalableQty.php on line 83

 

This when brings up the following Screenshot in Catalog view
https://pasteboard.co/Jhs7D2g.png

Link 83
https://pasteboard.co/Jhs95Pm.png

 

For a temporary fix, I can log in to the database and change the SKU in catalog_product_entity table. Just by adding a random number on the end.

 

But if I then edit the SKU and remove the random digit and enable the product this fixes the problem until I disable it again.

 

Tldr: When a product is disabled this shows the above error