List of questions
Related questions
Question 37 - AD0-E716 discussion
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.
Your answer:
0 comments
Sorted by
Leave a comment first