magento / magento/inventory

Child Product stock is assigned in other stock source and product page show out of stock item

Open
#3,449 3 comments 0 reactions 1 assignee Claimed by @ananth-iyer View on GitHub
Issue: ready for confirmation
Dominant language
PHP
Stars
357
Forks
262
PR merge metrics
No merged PRs in 30d

Description

### Preconditions (*)

1. Magento - 2.4.8-p3
2. magento/inventory-metapackage - 1.2.8-p3
3. PHP 8.3

### Steps to reproduce (*)

1. First create 4 websites then create MSI source and create stock
2. Create a new configurable product in non-default website scope
3. In child products, assign stock to non-default source. Do not use default source.
4. Open product in new website. it will show options out of stock status
5. The default stock id should not be used in all products.
6. Issue found in `vendor/magento/module-inventory-catalog/Plugin/InventoryIndexer/Model/ResourceModel/GetBulkLegacyStockStatusDataFromStockRegistry.php`
7. On line, `if ($this->defaultStockProvider->getId() === $stockId) {` - if it not default stock id then skips and `$results` is empty so `$originalResults` data is not considered.
8. It returns empty & wrong data

### Expected result (*)

1. $results is empty then it should consider $originalResults

### Actual result (*)

1. Child items show FALSE POSITIVE - out of stock status. Although there are in stock.

Thank you.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.