magento / magento/inventory

Incorrect processing of products with non-manageable stock absent in stock index

Open
#2,131 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Bug Progress: ready for dev
Dominant language
PHP
Stars
357
Forks
262
PR merge metrics
No merged PRs in 30d

Description

### Description
In case where a new Product was created with no source/stock assignment (or assignment to a non-default source/stock) and has `Manage Stock = false` in its Advanced Inventory settings it would not show up in the frontend.

Currently, a set of plugins in the `InventoryCatalog` module are responsible for adapting catalog inventory stock status to use indexes provided by MSI. These plugins are joining stock index and products for the frontend product collection. Product, with combination of settings described above, never gets into the stock index and therefore is absent in the product collections

### Possible solutions
* Changing appropriate `INNER JOIN` to `LEFT JOIN` might do the trick
* Other adjustments may be done to the resulting collections to select products in question

Note: None of these possible solutions were verified and may be incorrect.

### Possibly related items
* https://github.com/magento-engcom/msi/issues/2097
* https://github.com/magento-engcom/msi/issues/2106

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by inspecting the InventoryCatalog plugins that adapt catalog inventory stock status and join MSI stock indexes to frontend product collections. Reproduce a product with no source or a non-default source/stock and Manage Stock set to false, then trace why it is absent from the stock index or collection. Done means the product appears in frontend product collections without regressing stock filtering.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend, databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.