Repository navigation
feat: feed the customer rating facet of the product listings - #30
Merged
anoziere merged 6 commits intoOct 21, 2026
Merged
Conversation
anoziere
force-pushed
the
feat/473-rating-facet-source
branch
from
October 18, 2026 17:34
ca17a60 to
19c123e
Compare
Contributor
|
Review done, nothing to fix in the code. I pushed one commit that raises the requirement to Thelia 3.3 ( |
Contributor
|
Correction of my earlier note: no need to wait for 3.3.0. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The core adds a customer rating facet to the product listings: 4, 3 and 2 stars and up. The core holds no review, so it reads them through
Thelia\Domain\Catalog\Product\ProductRatingSourceInterface, which a review module implements. Without an implementation the facet does not show.What
Comment\Front\RatingFacetSourceimplements the interface. It compares the stored average of the accepted comments (meta_data,COMMENT_RATING), the figure the product card shows and the best-rated order sorts on, cast the same way, so the facet and the order never disagree.comment_max_rating). The threshold is brought to that scale: 4 stars and up on a shop rating out of ten means an average of 8 or more.RatingMetaStorageInterface::elementIdsRatedAtLeast(), implemented byRatingMetaRepositoryand by the in-memory double of the tests.configureServices()leaves the class out, so the module still installs there.Companion pull request
The core pull request that adds the facet and the interface (
thelia/thelia).Tests
Tests/Unit/Front/RatingFacetSourceTest.php: threshold on the stored average, scale of the shop, products asked about, ratings of other elements ignored. The scale test was seen red with the conversion removed. Module suite: 115 tests.The SQL of
elementIdsRatedAtLeast()is not covered by the module tests, which run without a database. It was checked on the demo database: five reviews accepted in the back office, the facet then offered 4 stars and up (2 products), 3 and up (3) and 2 and up (4), and 4 and up kept the two expected products.