inventory icon indicating copy to clipboard operation
inventory copied to clipboard

Update StockStatusExpressionForDefaultStock.php

Open pmathbliss opened this issue 1 year ago • 2 comments

Indexed cataloginventory_stock_status.stock_status not updating if the inventory goes from out of stock to in stock. The original code used the same value in the cataloginventory_stock_status.

Description (*)

Fixed Issues (if relevant)

  1. Fixes magento/inventory#<issue_number>: Issue title

Manual testing scenarios (*)

  1. Take a simple product with that is out of stock, enabled and has a row in cataloginventory_stock_status
  2. Update quantity > 0 and is_in_stock to 1.
  3. Run the cataloginventory_stock indexer.

Questions or comments

Contribution checklist (*)

  • [ ] Pull request has a meaningful description of its purpose
  • [ ] All commits are accompanied by meaningful commit messages
  • [ ] All new or changed code is covered with unit/integration tests (if applicable)
  • [ ] All automated tests passed successfully (all builds are green)

pmathbliss avatar Jun 13 '23 15:06 pmathbliss

any update on the issue yet?

LudwigDev9 avatar Apr 08 '24 10:04 LudwigDev9

Running into this issue also, and while it seems to fix the reindexing, it feels a bit weird as a fix to me...

as if stock status is not null, we use

'cisi.is_in_stock'

otherwise

$isAggregate ? 'MAX(cisi.is_in_stock)' : 'cisi.is_in_stock'

dio5 avatar Apr 09 '24 16:04 dio5