How to check Salable quantity in Magento2?
Method to Get Product Salable Quantity in Magento 2
- public function __construct(GetSalableQuantityDataBySku $getSalableQuantityDataBySku) {
- $this->getSalableQuantityDataBySku = $getSalableQuantityDataBySku; }
- public function getProductSalableQty() {
- echo json_encode($salable); }
What is product Salable quantity?
The salable quantity is a sum of all reservations made to a product, so the salable amount will be the quantity in stock 15 less the sum of the reservation rows (-5 + 3), the salable will be 13.
How to get product salable quantity in Magento 2?
If you have downloaded the Magento 2.3.3 version, you might have seen the salable quantity and quantity in the product grid. For instance, the admin may want to hide the SKU and stock status if the salable quantity is zero and if it is greater than zero, show the SKU and stock status in Magento 2 store.
Why is my qty not showing in Magento 2.3?
In Magento 2.3 you need to configure inventory sources in addition to adding product quantity. Check following 2 things: Under Stores => Inventory => Sources you have at least one source available. If not then you found the problem.
Why is product grid showing zero in Magento 2?
The issue is possibly caused when Import/Export DataBase Views was not created in Magento 2.3. So create Views and inventory_stock_1 table in DataBase. I skipped this line of query, due to Previllages error and my add to cart was not working on live server, in local server this line was not skipped and add to cart was working fine.
Why is my product table not showing in Magento?
The issue is possibly caused by the missing DB tables with connections/relations to the Product Table. The solution would be: Check whether All DB Tables (including data) from the old DB are all copied to the new DB Schema. Check if inventory_stock_1 Table does exist and is filled with data relating to your Product Table.