Price Filter in Advanced Search with Tier Prices fix #2644
Seppmann
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi there,
M2.3.4-p2, Elasticsuite Version 2.10.10
Issue
I encountered that in "advanced search" the price filter will return also products that are not in the price range, when there are different customerGroups with different Tier Prices.
Expected
"advanced search" price filter should return only products that are in the price range (respecting customerGroups individual Tier prices).
Solution
The conditions used for the price range in
\Smile\ElasticsuiteCore\Search\Request\Query\Filter\QueryBuilder -> prepareFieldCondition
should be the ones used in the layered navigation price filter (here cutomerGroups are respected in the filtering as it should).
So as a fix I've rewritten the
\Smile\ElasticsuiteCore\Search\Request\Query\Filter\QueryBuilder
class and added the
getRangeCondition
method (originally found inSmile\ElasticsuiteCatalog\Model\Layer\Filter\Price
).In
prepareFieldCondition
method I use thegetRangeCondition
method then if user filters in advanced search by price. LikeAfter that customerGroups in advanced search price range filter are respected and only products in price range are shown.
I dont know if my solution is the best way to fix the issue. If you have better solutions/suggestions, please let me know!
Thanks and best regards
Sebastian
Beta Was this translation helpful? Give feedback.
All reactions