custom/plugins/EnidConnectorNext/src/Subscriber/NetIDSubscriber.php line 30

Open in your IDE?
  1. <?php
  2. namespace Enid\EnidConnectorNext\Subscriber;
  3. use Enid\EnidConnectorNext\Service\SettingService;
  4. use Shopware\Storefront\Pagelet\Footer\FooterPageletLoadedEvent;
  5. use Symfony\Component\EventDispatcher\EventSubscriberInterface;
  6. class NetIDSubscriber implements EventSubscriberInterface
  7. {
  8.     /**
  9.      * @var \Enid\EnidConnectorNext\Service\SettingService
  10.      */
  11.     private SettingService $settingService;
  12.     public function __construct(
  13.         SettingService $settingService
  14.     )
  15.     {
  16.         $this->settingService $settingService;
  17.     }
  18.     public static function getSubscribedEvents(): array
  19.     {
  20.         return [
  21.             FooterPageletLoadedEvent::class => 'onFooterLoaded'
  22.         ];
  23.     }
  24.     public function onFooterLoaded(FooterPageletLoadedEvent $event)
  25.     {
  26.         $event->getPagelet()->addExtension('enidConnectorNextThemeSettings',
  27.             $this->settingService->getThemeSettings($event->getSalesChannelContext()->getSalesChannelId())
  28.         );
  29.     }
  30. }