Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Adobe Exam AD0-E716 Topic 8 Question 15 Discussion

Actual exam question for Adobe's AD0-E716 exam
Question #: 15
Topic #: 8
[All AD0-E716 Questions]

An Adobe Commerce developer wants to generate a list of products using ProductRepositorylnterf ace and search for products using a supplier_id filter for data that is stored in a standalone table (i.e., not in an EAV attribute).

Keeping maintainability in mind, how can the developer add the supplier ID to the search?

Show Suggested Answer Hide Answer
Suggested Answer: B

The developer can add a custom filter to the virtual type Magento\Catalog\Model\Api\SearchCriteria\CollectionProcessor\ProductFilterProce5sor for supplier_id field. In the custom filter, the developer can apply the needed join and filter to the passed $collection. This is the recommended way to extend the search criteria for products using dependency injection and plugins. Verified Reference: [Magento 2.4 DevDocs] [Magento Stack Exchange]


Contribute your Thoughts:

Denny
14 hours ago
I disagree, I believe option C is more efficient in this case.
upvoted 0 times
...
Cecily
2 days ago
I think option A is the best approach to add the supplier ID to the search.
upvoted 0 times
...

Save Cancel