<?php declare(strict_types=1);
namespace Xioni\Xconfig\Storefront\Page\Navigation\Subscriber;
use Shopware\Core\Framework\Struct\ArrayEntity;
use Shopware\Storefront\Page\Navigation\NavigationPageLoadedEvent;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
class NavigationPageSubscriber implements EventSubscriberInterface
{
public static function getSubscribedEvents()
{
return [
NavigationPageLoadedEvent::class => 'onNavigationPageLoaded'
];
}
public function onNavigationPageLoaded(NavigationPageLoadedEvent $event): void
{
// $page = $event->getPage();
// $elements = $page->getCmsPage()->getElementsOfType("product-listing");
// var_dump($elements);
}
}