magento / magento/inventory

salable quantity is not available in the elastic search bucket list

Open
#3,286 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Preconditions (*)
  1. Magento 2.4.1
  2. MultiSourceInventory
Steps to reproduce (*)
  • Create two websites
  • Create a few different sources
  • Create 2 stocks for two websites (Stock1 -> Website 1 , Stock 2 -> Website 2 )
  • Create a product and assign to both websites
  • Add stock quantity only to Stock 1 but not Stock 2 so that the product is salable in Website 1 and out of stock in Website 2

Case 1: Try to add an elastic search query for is_salable
Case 2: Try to build an elastic search query for stock_status

Expected result (*)

Case 1: The is_salable field is added in the bucket list and we can use it for searches
Case 2: The stock_status field should be about the the current website

Actual result (*)

Case 1: The is_salable field is ignored because it's not in the bucket list.
Case 2: We get incorrect results regarding stock status.

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 reproducing both Elasticsearch query cases in Magento 2.4.1 with MultiSourceInventory, using the two websites, stocks, and product setup described. No file or test is named; done means is_salable is available for bucket-list searches and stock_status reflects the current website.

Written by the indexing model from the issue text.

Assessment

Tech stack
elasticsearch, php
Domain
backend, search
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.