custom/plugins/XioniXconfig/src/Storefront/Page/Navigation/Subscriber/NavigationPageSubscriber.php line 18

Open in your IDE?
  1. <?php declare(strict_types=1);
  2. namespace Xioni\Xconfig\Storefront\Page\Navigation\Subscriber;
  3. use Shopware\Core\Framework\Struct\ArrayEntity;
  4. use Shopware\Storefront\Page\Navigation\NavigationPageLoadedEvent;
  5. use Symfony\Component\EventDispatcher\EventSubscriberInterface;
  6. class NavigationPageSubscriber implements EventSubscriberInterface
  7. {
  8.     public static function getSubscribedEvents()
  9.     {
  10.         return [
  11.             NavigationPageLoadedEvent::class => 'onNavigationPageLoaded'
  12.         ];    
  13.     }    
  14.     
  15.     public function onNavigationPageLoaded(NavigationPageLoadedEvent $event): void
  16.     {
  17.         // $page = $event->getPage();
  18.         // $elements = $page->getCmsPage()->getElementsOfType("product-listing");
  19.         // var_dump($elements);
  20.     }        
  21. }