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?
The developer can add a custom filter to the virtual type MagentoCatalogModelApiSearchCriteriaCollectionProcessorProductFilterProce5sor 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]
Tricia
5 months agoSylvie
5 months agoRenea
5 months agoProvidencia
5 months agoShonda
6 months agoMabel
6 months agoShawn
6 months agoGerald
6 months agoKati
6 months agoMitsue
6 months agoShannan
6 months agoDulce
7 months agoAvery
7 months ago