custom/plugins/UltraFooterTunerProModulOne/src/Subscriber/Frontend.php line 23

Open in your IDE?
  1. <?php declare(strict_types=1);
  2. namespace Ultra\Footer\Tuner\Pro\Modul\One\Subscriber;
  3. use Shopware\Core\Framework\Struct\ArrayEntity;
  4. use Symfony\Component\EventDispatcher\EventSubscriberInterface;
  5. use Shopware\Core\System\SystemConfig\SystemConfigService;
  6. use Shopware\Storefront\Event\StorefrontRenderEvent;
  7. class Frontend implements EventSubscriberInterface{    
  8.     private $systemConfigService;
  9.     
  10.     public function __construct(SystemConfigService $systemConfigService)    {        
  11.         $this->systemConfigService $systemConfigService;
  12.         }        
  13.         
  14.     public static function getSubscribedEvents(): array    {        
  15.         return[            
  16.             StorefrontRenderEvent::class => 'onStorefrontRender'        
  17.             ];
  18.     }    
  19.     
  20.     public function onStorefrontRender(StorefrontRenderEvent $event)    {    
  21.             $event->getSalesChannelContext()->getSalesChannel()->assign(['UltraFooterTunerProModulOne' => $this->systemConfigService->get('UltraFooterTunerProModulOne.config'$event->getContext()->getSource()->getSalesChannelId())]);
  22.     }
  23. }