custom/static-plugins/WexoCytexSearch/src/Subscriber/SearchSubscriber.php line 24

Open in your IDE?
  1. <?php declare(strict_types=1);
  2. namespace Wexo\CytexSearch\Subscriber;
  3. use Shopware\Core\Content\Product\Events\ProductSuggestCriteriaEvent;
  4. use Symfony\Component\EventDispatcher\EventSubscriberInterface;
  5. class SearchSubscriber implements EventSubscriberInterface
  6. {
  7.     /**
  8.      * @return string[]
  9.      */
  10.     public static function getSubscribedEvents()
  11.     {
  12.         return [
  13.             ProductSuggestCriteriaEvent::class => 'onProductSuggestCriteria',
  14.         ];
  15.     }
  16.     /**
  17.      * @param ProductSuggestCriteriaEvent $event
  18.      * @return void
  19.      */
  20.     public function onProductSuggestCriteria(ProductSuggestCriteriaEvent $event): void
  21.     {
  22.         $event->getCriteria()->setLimit(24);
  23.     }
  24. }