custom/plugins/HBCTheme/src/Subscriber/ProductListingCriteriaEventSubscriber.php line 22

Open in your IDE?
  1. <?php
  2. namespace HBCTheme\Subscriber;
  3. use  \Shopware\Core\Framework\DataAbstractionLayer\Search\Criteria;
  4. use Shopware\Core\Content\Product\Events\ProductSearchCriteriaEvent;
  5. use Shopware\Core\Framework\DataAbstractionLayer\EntityRepositoryInterface;
  6. use Shopware\Core\Framework\DataAbstractionLayer\Search\Filter\EqualsFilter;
  7. use Symfony\Component\EventDispatcher\EventSubscriberInterface;
  8. class ProductListingCriteriaEventSubscriber implements EventSubscriberInterface{
  9.     public static function getSubscribedEvents()
  10.     {
  11.         return [
  12.             ProductSearchCriteriaEvent::class => 'addProperties'
  13.         ];
  14.     }
  15.     public function addPropertiesProductSearchCriteriaEvent $event)
  16.     {
  17.         $criteria $event->getCriteria();
  18.         return $criteria;
  19.     }
  20. }