Skip to content

Export the real product salability as Availability - #545

Open
amenk wants to merge 1 commit into
FACT-Finder-Web-Components:release/5.xfrom
iMi-digital:fix/availability-from-salability
Open

Export the real product salability as Availability#545
amenk wants to merge 1 commit into
FACT-Finder-Web-Components:release/5.xfrom
iMi-digital:fix/availability-from-salability

Conversation

@amenk

@amenk amenk commented Jul 31, 2026

Copy link
Copy Markdown

The Availability column was derived from the status flags of the inventory_source_item rows of a product. That is not the salability Magento itself uses: in single source mode the salability is read from the legacy stock tables (the inventory_stock_1 view), and installations which write stock data without going through the MSI synchronization end up with no source item at all. Those products were exported with Availability=0 although they are in stock and orderable, which makes ranking rules drop them from the search results.

The availability is now resolved through AreProductsSalableInterface, which returns the same result as the storefront in both single and multi source setups. GetSourceItemsBySku is no longer needed, so the module depends on magento/module-inventory-sales-api instead of magento/module-inventory.

  • Tested with Magento editions/versions:
    • 2.4.8-p5
  • Tested with PHP versions:
    • 8.4

Co-authored-by: Claude Opus 5.0

The Availability column was derived from the status flags of the
inventory_source_item rows of a product. That is not the salability
Magento itself uses: in single source mode the salability is read from
the legacy stock tables (the inventory_stock_1 view), and installations
which write stock data without going through the MSI synchronization end
up with no source item at all. Those products were exported with
Availability=0 although they are in stock and orderable, which makes
ranking rules drop them from the search results.

The availability is now resolved through AreProductsSalableInterface,
which returns the same result as the storefront in both single and multi
source setups. GetSourceItemsBySku is no longer needed, so the module
depends on magento/module-inventory-sales-api instead of
magento/module-inventory.
@amenk
amenk requested a review from Rayn93 as a code owner July 31, 2026 10:05
@amenk

amenk commented Jul 31, 2026

Copy link
Copy Markdown
Author

The patch might only cover a deeper problem - we have problems with MSI source items in our store. Feel free to disregard.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant