-
Notifications
You must be signed in to change notification settings - Fork 10.7k
Add Products by Brand Collection to Product Collection Block
#62817
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Products by Brand Collection to Product Collection Block
#62817
Conversation
… no brand is selected
Testing GuidelinesHi @woocommerce/rubik, Apart from reviewing the code changes, please make sure to review the testing instructions (Guide) and verify that relevant tests (E2E, Unit, Integration, etc.) have been added or updated as needed. Reminder: PR reviewers are required to document testing performed. This includes:
|
📝 WalkthroughWalkthroughAdds a new "Products by Brand" product-collection to WooCommerce: client block definition and registration, inspector taxonomy support, CoreCollectionNames enum entry, PHP handler registration, and a PHPUnit test validating brand-based queries. Changes
Sequence Diagram(s)sequenceDiagram
participant Editor as Editor UI
participant Inspector as Inspector Controls
participant ClientBlock as Product Collection Block
participant Backend as PHP Handler
participant DB as Database
Editor->>ClientBlock: insert "Products by Brand" collection
Editor->>Inspector: open taxonomy panel
Inspector->>ClientBlock: select brand (e.g., "Nike")
ClientBlock->>Backend: request products filtered by brand
Backend->>DB: query products with product_brand = "Nike"
DB-->>Backend: return matching products
Backend-->>ClientBlock: return product list
ClientBlock-->>Editor: render products and pagination
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
kmanijak
left a comment
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.
It's looking good! Thanks a lot for this contribution!
I left some minor comment and one open question (I don't have a strong opinion so let's discuss briefly). Once resolved, I'll be happy to merge the PR! 🙌
...commerce/client/blocks/assets/js/blocks/product-collection/edit/inspector-controls/index.tsx
Outdated
Show resolved
Hide resolved
plugins/woocommerce/src/Blocks/BlockTypes/ProductCollection/HandlerRegistry.php
Show resolved
Hide resolved
kmanijak
left a comment
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.
Thanks for answering to my comments! There's just one lint error remaining and let's ship it 🚢 !
plugins/woocommerce/client/blocks/assets/js/blocks/product-collection/collections/by-brand.tsx
Outdated
Show resolved
Hide resolved
kmanijak
left a comment
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.
Thanks for super quick reaction! Let's merge it!
Submission Review Guidelines:
Changes proposed in this Pull Request:
Closes #62368
Screenshots or screen recordings:
Screen.Recording.2026-01-15.at.7.06.19.PM.mov
How to test the changes in this Pull Request:
Using the WooCommerce Testing Instructions Guide, include your detailed testing instructions:
Product Collectionblock and select theProducts by Brandscollection.No products to display.Testing that has already taken place:
Milestone
Changelog entry
Changelog Entry Details
Significance
Type
Message
Changelog Entry Comment
Comment