Adobe Commerce Developer Expert AD0-E716 Question # 2 Topic 1 Discussion

Adobe Commerce Developer Expert AD0-E716 Question # 2 Topic 1 Discussion

AD0-E716 Exam Topic 1 Question 2 Discussion:
Question #: 2
Topic #: 1

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?


A.

Write a before plugin on \Hagento\catalogVtodel\ProductRepository: :geti_ist() and register the search criteria passed. Write an event observer to 0 listen for the event cataiog_product_coiiection_ioad_before. Iterate through the registered search criteria, and if found, apply the needed join and filter to the events scollection.


B.

Add a CUStOm filter to the Virtual type "agento\Catalog\Model\Api\SearchCriteria\CollectionProcessor\ProductFilterProce5sor for supplier_id field. In

the custom filter, apply the needed join and filter to the passed $collection.


C.

Write a before plugin On \Magento\Framework\Api\SearchCriteria\CollectionProcessorInterface: :process(). Iterate through the $searchCriteria

provided for supplier_id, and if found, apply the needed join and filter to the passed scollection.


Get Premium AD0-E716 Questions

Contribute your Thoughts:


Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.