<?php declare(strict_types=1);
namespace Ultra\Footer\Tuner\Pro\Modul\One\Subscriber;
use Shopware\Core\Framework\Struct\ArrayEntity;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Shopware\Core\System\SystemConfig\SystemConfigService;
use Shopware\Storefront\Event\StorefrontRenderEvent;
class Frontend implements EventSubscriberInterface{
private $systemConfigService;
public function __construct(SystemConfigService $systemConfigService) {
$this->systemConfigService = $systemConfigService;
}
public static function getSubscribedEvents(): array {
return[
StorefrontRenderEvent::class => 'onStorefrontRender'
];
}
public function onStorefrontRender(StorefrontRenderEvent $event) {
$event->getSalesChannelContext()->getSalesChannel()->assign(['UltraFooterTunerProModulOne' => $this->systemConfigService->get('UltraFooterTunerProModulOne.config', $event->getContext()->getSource()->getSalesChannelId())]);
}
}