-
Notifications
You must be signed in to change notification settings - Fork 221
Product Query: Add order by “Top rated” as a preset #7715
Product Query: Add order by “Top rated” as a preset #7715
Conversation
TypeScript Errors ReportFiles with errors: 427 🎉 🎉 This PR does not introduce new TS errors. |
The release ZIP for this PR is accessible via:
|
Size Change: +17 B (0%) Total Size: 971 kB
ℹ️ View Unchanged
|
7cda22f
to
13a0331
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work 🎉 ! The feature works as expected: left a few suggestions in the code and a question regarding the tests.
Test Results
Add a Product Query block. Change “Newest” to “Top rated” on the Popular Filters dropdown..
✅ Confirmed the "Top rated" option exists
Ensure the new order is based on the average rating.
✅ Confirmed it works as expected.
✅ When the product ratings are updated, the block displays the correct updated order based on the new average rating.
Ensure steps 4 and 6 work on the front-end.
Do you mind clarifying what steps 4 and 6 are?
🤦♀️ sorry. I edited the PR description. I just meant check that the order is preserved on the front-end. |
f1da26d
to
5a3db96
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🚀 !
* Add safety guard to `extend_rest_query_allowed_params`
This PR adds support for the second preset: “Top rated products”. By selecting this, users can sort products by their average rating.
This builds on the previously added REST API filter to enable further allowed sort orders.
Fixes #7326
Accessibility
Testing
User Facing Testing
WooCommerce Visibility
Changelog