magento2: "Sort By: Price" issues with Configurable Products does not work without forced reindex
Preconditions
Verified with 2 clean installations (no 3rd party modules)
- Magento 2.3.1 CE
- ElasticSearch 5.6.14
- Production Mode
- Index on Schedule
And:
- Magento 2.2.6 CE
- ElasticSearch 5.6.14
- Production Mode
- Index on Schedule
Steps to reproduce
- Install clean Magento 2 instance
- Deploy Sample Data
- Run setup:upgrade (to install sample data)
- Enter any category, choose “Price” as a “Sort By”
Expected Result
- Products are displayed from the cheapest to the most expensive
Actual Result
- Getting products with prices: 29.00, 22.00, 28.00, 24.00
Notice that also star rating is missing before manual reindex.
Under the hood, the difference is quite big:
Before: BEFORE_result.json.txt
After AFTER_result.json.txt
Workaround
Run bin/magento index:reindex
until products are in the right order (sometimes more than once)
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 31 (21 by maintainers)
Commits related to this issue
- #23180 attempt to fix final_price, price indexing for configurable product — committed to ilnytskyi/magento2 by ilnytskyi 5 years ago
- Test fix #23180 PR 24759 — committed to ilnytskyi/magento2 by ilnytskyi 5 years ago
- Only final price change #23180 PR 24759 — committed to ilnytskyi/magento2 by ilnytskyi 5 years ago
@chdzma
I found a solution in this file.
/vendor/magento/module-configurable-product/Model/ResourceModel/Product/Indexer/Price/Configurable.php
I commented out this section in the function fillTemporaryOptionsTable
And now it works correctly, it’s absurd because every product is in the same condition, enabled, and out of stock.
I commented directly in the core, since I’m really sick of working on Magento2 and I want to close this project as soon as possibile. When I finish this my agency will abandon the platform for something else.
Last week I wasted three days of work for not-working shipping e-mail. I’m really annoyed.
This issue should be reopened as well!
Hi @lbajsarowicz, @ilnytskyi, @engcom-Delta.
Thank you for your report and collaboration!
The related internal Jira ticket
MC-23835
was closed asnon-reproducible
in2.4-develop
. It means that Magento team either unable to reproduce this issue using provided Steps to Reproduce from the Description section on clean Magento instance or the issue has been already fixed in the scope of other tasks.But if you still run into this problem please update or provide additional information/steps/preconditions in the Description section and reopen this issue.