vendor/lnb/shopware6-lnb-popup/src/Subscriber/FooterPageletLoadedSubscriber.php line 23

Open in your IDE?
  1. <?php
  2. namespace Lnb\Shopware6\LnbPopup\Subscriber;
  3. use Lnb\Shopware6\LnbPopup\Service\PopupResolver;
  4. use Shopware\Storefront\Pagelet\Footer\FooterPageletLoadedEvent;
  5. use Symfony\Component\EventDispatcher\EventSubscriberInterface;
  6. class FooterPageletLoadedSubscriber implements EventSubscriberInterface
  7. {
  8.     public function __construct(
  9.         private readonly PopupResolver $popupResolver
  10.     ) {
  11.     }
  12.     public static function getSubscribedEvents(): array
  13.     {
  14.         return [
  15.             FooterPageletLoadedEvent::class => 'onFooterLoaded',
  16.         ];
  17.     }
  18.     public function onFooterLoaded(FooterPageletLoadedEvent $event): void
  19.     {
  20.         $this->popupResolver->resolve($event->getPagelet(), $event->getSalesChannelContext());
  21.     }
  22. }