Skip to content

Conversation

@Pianczetti
Copy link

Questions Answers
Description? ps_facetedsearch: fix category facet so it matches deep subcategories (not only direct children). Implemented entirely in module to keep backward compatibility with PS 1.7/8/9. Uses a single subtree-scoped query (nleft/nright) to resolve category names within the current category subtree. Adds a batch multi-name lookup to minimize DB round-trips and a safe BFS fallback when needed.
Type? bug fix
BC breaks? no
Deprecations? no
Fixed ticket? Fixes PrestaShop/Prestashop#29727.
How to test? 1) Enable ps_facetedsearch and the “Categories” facet.
2) Create a tree: Parent (P) → Child (C) → Grandchild (G). Assign products to all categories
3) Rebuild the module’s index and clear cache.
4) Go to FO category page of P.
5) In the Categories facet, select G. Expected: product list shows only products from G (previously deeper subcategories were not matched).
Sponsor company

@ps-jarvis
Copy link

Hello @Pianczetti!

This is your first pull request on ps_facetedsearch repository of the PrestaShop project.

Thank you, and welcome to this Open Source community!

@github-project-automation github-project-automation bot moved this to Ready for review in PR Dashboard Aug 9, 2025
@AmandaIsFive
Copy link

Amazing, thank you!! Apparently it works perfectly. I hope they approve your PR soon to improve the module's functionality.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Ready for review

Development

Successfully merging this pull request may close these issues.

Facets search by second level subcategory does not work

3 participants