I have a site, with multiple stock sources, and backordering enabled. When I test adding to cart, Magento is not taking into account stock in all sources when determining the number of items to be back ordered.
EG
Default source: 3 items
Warehouse 1: 10 items
Warehouse 2: 5 items
When calculating the number of back order items in the cart, the following file is called:
MagentoInventorySalesModelGetProductSalableQty->execute()
This then calls:
$stockItemData = $this->getStockItemData->execute($sku, $stockId);
And this returns:
array(2) { ["quantity"]=> string(6) "3.0000" ["is_salable"]=> string(1) "1" }
This result is returned based on the running of the following query:
SELECT `cataloginventory_stock_status`.`qty` AS `quantity`, `cataloginventory_stock_status`.`stock_status` AS `is_salable` FROM `cataloginventory_stock_status` WHERE (product_id = 20)
The GetProductSalableQty->execute() method also takes into account reservations, and minQty…but these are both zero.
Why isnt Magento taking into account items in all sources when calculating backorder information for the customer?
PS
Am I using MSI correctly, should the default source include all items from all other possible locations? This is not what I am seeing in online information explaining about MSI usage.