<?php
namespace Lnb\Shopware6\LnbPopup\Subscriber;
use Lnb\Shopware6\LnbPopup\Service\PopupResolver;
use Shopware\Storefront\Pagelet\Footer\FooterPageletLoadedEvent;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
class FooterPageletLoadedSubscriber implements EventSubscriberInterface
{
public function __construct(
private readonly PopupResolver $popupResolver
) {
}
public static function getSubscribedEvents(): array
{
return [
FooterPageletLoadedEvent::class => 'onFooterLoaded',
];
}
public function onFooterLoaded(FooterPageletLoadedEvent $event): void
{
$this->popupResolver->resolve($event->getPagelet(), $event->getSalesChannelContext());
}
}