custom/plugins/JkwebShopwareAutoTranslatePlugin/src/Subscriber/StorefrontRenderSubscriber.php line 30

Open in your IDE?
  1. <?php declare(strict_types=1);
  2. namespace Jkweb\Shopware\Plugin\AutoTranslate\Subscriber;
  3. use BabyMarkt\DeepL\DeepL;
  4. use Shopware\Core\Framework\Context;
  5. use Shopware\Core\System\SystemConfig\SystemConfigService;
  6. use Shopware\Storefront\Event\StorefrontRenderEvent;
  7. use Symfony\Component\EventDispatcher\EventSubscriberInterface;
  8. use Symfony\Component\Messenger\MessageBusInterface;
  9. class StorefrontRenderSubscriber implements EventSubscriberInterface
  10. {
  11.     /** @var SystemConfigService */
  12.     private $systemConfigService;
  13.     public function __construct(SystemConfigService $systemConfigService)
  14.     {
  15.         $this->systemConfigService $systemConfigService;
  16.     }
  17.     public static function getSubscribedEvents(): array
  18.     {
  19.         return [
  20.             StorefrontRenderEvent::class => 'onRender',
  21.         ];
  22.     }
  23.     public function onRender(StorefrontRenderEvent $event): void
  24.     {
  25.         $event->setParameter("autoTranslateNotifyInStorefront"$this->systemConfigService->get("JkwebShopwareAutoTranslatePlugin.config.notifyInStorefront"));
  26.     }
  27. }