inventory
inventory copied to clipboard
Update StockStatusExpressionForDefaultStock.php
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)
- Fixes magento/inventory#<issue_number>: Issue title
Manual testing scenarios (*)
- Take a simple product with that is out of stock, enabled and has a row in cataloginventory_stock_status
- Update quantity > 0 and is_in_stock to 1.
- 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)
any update on the issue yet?
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'