-
Notifications
You must be signed in to change notification settings - Fork 9.4k
M2.2.6 : "Order by price" not working in product listing #18264
Copy link
Copy link
Closed
Labels
Component: CatalogComponent: IndexerFixed in 2.2.xThe issue has been fixed in 2.2 release lineThe issue has been fixed in 2.2 release lineIssue: Clear DescriptionGate 2 Passed. Manual verification of the issue description passedGate 2 Passed. Manual verification of the issue description passedIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedGate 1 Passed. Automatic verification of issue format passedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentGate 4. Acknowledged. Issue is added to backlog and ready for developmentReproduced on 2.2.xThe issue has been reproduced on latest 2.2 releaseThe issue has been reproduced on latest 2.2 releaseReproduced on 2.3.xThe issue has been reproduced on latest 2.3 releaseThe issue has been reproduced on latest 2.3 release
Metadata
Metadata
Assignees
Labels
Component: CatalogComponent: IndexerFixed in 2.2.xThe issue has been fixed in 2.2 release lineThe issue has been fixed in 2.2 release lineIssue: Clear DescriptionGate 2 Passed. Manual verification of the issue description passedGate 2 Passed. Manual verification of the issue description passedIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedGate 1 Passed. Automatic verification of issue format passedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentGate 4. Acknowledged. Issue is added to backlog and ready for developmentReproduced on 2.2.xThe issue has been reproduced on latest 2.2 releaseThe issue has been reproduced on latest 2.2 releaseReproduced on 2.3.xThe issue has been reproduced on latest 2.3 releaseThe issue has been reproduced on latest 2.3 release
I'm running into the issue on a Magento 2.2.6 installation the "order by price" option for a product listing is not working. Neither ascending or descending.
Preconditions
Steps to reproduce
I'm not sure if it is part of the conditions to reproduce the problem but:
Expected result
As a customer, If I order a product listing on price, the products should be ordered on price.
Actual result
They aren't
Own research
If I look at the query that is eventually created by
\Magento\Catalog\Block\Product\ListProduct::initializeProductCollection(), I get the following result:The main thing I notice here is that it gets ordered by
price_index.min_price. But if I look at my price index,min_priceis set to0everywhere, except for the products that have a special price set.This caused me to look at the
catalog_product_price_index-table where I saw the same: almost all products have amin_priceof 0, except the products that have special price set.A
bin/magento indexer:reindexor a re-save of the product does not change the price index.So the problem might be the product listing (should it perhaps use a different column from the price index?) or should the price index have a min_price of at least the default price for regular products?