class ExampleListingSubscriber implements EventSubscriberInterface
public static function getSubscribedEvents(): array
ProductListingCollectFilterEvent::class => 'addFilter'
public function addFilter(ProductListingCollectFilterEvent $event): void
// fetch existing filters
$filters = $event->getFilters();
$request = $event->getRequest();
$filtered = (bool) $request->get('isCloseout');
// unique name of the filter
// defines if this filter is active
// Defines aggregations behind a filter. A filter can contain multiple aggregations like properties
new MaxAggregation('active', 'product.isCloseout'),
[new EqualsFilter('product.isCloseout', true)]
// defines the DAL filter which should be added to the criteria
new EqualsFilter('product.isCloseout', true),
// defines the values which will be added as currentFilter to the result
// Add your custom filter