where i can update the saleable quantity in magento 2.3 ..the above tab is showing blank.
And how to update saleable quantity programmatic
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It only takes a minute to sign up.
Sign up to join this communitywhere i can update the saleable quantity in magento 2.3 ..the above tab is showing blank.
And how to update saleable quantity programmatic
I have same issue with resolved, take inventory_source_item
table backup first.
Run sql query:
INSERT IGNORE INTO `inventory_source_item` (source_code, sku, quantity, status)
select 'default', sku, qty, stock_status from (`cataloginventory_stock_status` as `lg` join `catalog_product_entity` as `prd` on((`lg`.`product_id` = `prd`.`entity_id`)))
Apply command:
php bin/magento indexer:reindex
php bin/magento cache:flush
Inventory_stock_1
but some product not able to add in cart. Error: Product that you are trying to add is not available.
Jan 23, 2020 at 13:01
The most probable reason is that you did not assign your product to any Source. As soon as the product would be assigned Magento would calculate Salable product Quantity automatically.
Read more about Salable Quantity calculation and Inventory Management in Magento 2.3 here - https://docs.magento.com/m2/ce/user_guide/catalog/inventory-management.html
In Magento v2.3
If you want to use MSI:
Check inventory_reservation
If you don't want to use MSI turn the All Magento Inventory Modules Disable :
https://devdocs.magento.com/guides/v2.3/inventory/index.html
IN DataBase There was two type
1> Tables and
2> Views
also The issue is possibly caused When Import/Export DataBase Views Was Not Created in magento 2.3 So check Views and inventory_stock_1 table In DataBase.
Answer by manoj pal above worked for me. The inventory_source_item table was empty and required one-time population.
After setting up Inventory Stocks/Sources in the back end, I observed these problems with my installation that needed fixing:
You could not add a product to cart on front end. 'Product that you are trying to add is not available.'
In the back-end, in the product table, the 'Salable quantity' column was blank, i.e. nothing showing in the table cell.
In the back end, the 'Product Saleable Quantity' twistie on the product page was also blank. Nothing was visible.
When saving a product in the back-end, I observed this error in the var/log/debug.log:
Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails CONSTRAINT INVENTORY_SOURCE_ITEM_SOURCE_CODE_INVENTORY_SOURCE_SOURCE_CODE
FOREIGN KEY (source_code
) REFERENCES inventory_source
(source_code
)), query was: INSERT INTO inventory_source_item
(source_code
, sku
, quantity
, status
) VALUES (?, ?, ?, ?) ON DUPLICATE KEY UPDATE quantity
= VALUES(quantity
), status
= VALUES(status
) [] []
Following instructions above by @manoj-pal fixed this, and I was able to add products to cart.
However, saleable quantity and the twistie was still blank in the admin back end! WTF. I then noticed the join table inventory_source_stock_link table was blank. Googling this took me to this post:
https://stackoverflow.com/questions/57213282/salable-quantity-in-magento-2-3-dont-show
I saw how he inserted the missing row into table inventory_source_stock_link. Once I had populated this table, the back-end product pages started to display 'Salable quantity' in both the table cell and the twistie.
I must say MSI shows lots of promise and capabilities but this upgrade to Inventory Management has been quite a drama!
The issue is possibly caused by the missing DB tables
with connections/relations to the Product Table
.
The solution would be:
All DB Tables
(including data) from the old DB
are all copied to the new DB Schema
. inventory_stock_1
Table does exist and is filled with data relating to your Product Table.In Magento 2.3 you need to configure inventory sources in addition to adding product quantity. Check following 2 things:
Name: Default Source, Code: default, under Address Data, select your store country & provide a zip code / postcode
. Save & ContinueReindex catalogue php bin/magento indexer:reindex
and clear the cache.
This should do the trick.
What worked for me was creating a new inventory source and assigning it to my products. Not entirely sure what the issue was but it was related to the default source created from the sample data.
In my case, problem was in assigning products to Source.
Check inventory_source_item
table in your DB. If you can't find your product(-s) by SKU - try to regenerate this table items manually.
Warning - it might work only for single stores view.
inventory_source_item
table.inventory_source_item
table.source_code
value from default
to yours, if needed)INSERT IGNORE INTO 'inventory_source_item'('source_code', 'sku', 'quantity', 'status') SELECT 'default', catalog_product_entity.sku , cataloginventory_stock_item.qty, 1 FROM 'catalog_product_entity' INNER JOIN 'cataloginventory_stock_item' ON catalog_product_entity.entity_id = cataloginventory_stock_item.product_id
Make sure you use table prefix if needed.
Reindex products
php bin/magento indexer:reindex
And flush cache
php bin/magento cache:flush