Describe the bug
When sorting products with a discount by price, the order is sometimes incorrect, despite rebuilding the price index and clearing cache in BO.
To Reproduce
Steps to reproduce the behavior:
Screenshots

Current sorting order:
23.16
23.98
23.98
23.96
23.96
23.98
23.98
25.48
24.98
Should be:
23.16
23.96
23.96
23.98
23.98
23.98
23.98
24.98
25.48
Additional information
PrestaShop version: 1.7.6.0
ps_facetedsearch version: 3.2.0
PHP version: 7.2.17
Hi @Twabi2,
Thanks for your report.
I manage to reproduce the issue with PS1.7.6.0 & the ps_facetedsearch v3.2.0.
Stes to reproduce the issue:


I鈥檒l add this to the debug roadmap so that it鈥檚 fixed. If you have already fixed it on your end or if you think you can do it, please do send us a pull request!
Thanks!
Ping @PierreRambaud
Hey @khouloudbelguith can you try again, I'm not able to reproduce:


@Twabi2
Could you try to click on "Index all missing prices" and "Clear cache" in faceted search module ?
Hi @PierreRambaud,
I tried with PS1.7.6.1 & ps_facetedsearch v3.2.1.
Cache is cleared & Price is indexed
https://drive.google.com/file/d/1wrURuqmTKH7BgSCZa6LnwMWaj_KsNRi3/view
In this second shop "Price High to Low" is incorrect.

Thanks!
Can you tell me if with my new PR everything is ok for you? https://github.com/PrestaShop/ps_facetedsearch/pull/130
I also add a hook when Catalog Price Rules is set.
@PierreRambaud, yes, I checked your PR & it is OK for me
https://drive.google.com/file/d/1CTY3q4xQqxdc63mxd-UbHBJ86zauBx0J/view
Thanks!
Most helpful comment
@PierreRambaud, yes, I checked your PR & it is OK for me
https://drive.google.com/file/d/1CTY3q4xQqxdc63mxd-UbHBJ86zauBx0J/view
Thanks!