<?php declare(strict_types=1);
namespace Nd\Voorwinden\Subscriber;
use Shopware\Storefront\Page\Product\ProductPageCriteriaEvent;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
class AdditionalImageCriteria implements EventSubscriberInterface
{
public static function getSubscribedEvents(): array
{
return [
ProductPageCriteriaEvent::class => 'onProductCriteriaLoaded'
];
}
public function onProductCriteriaLoaded(ProductPageCriteriaEvent $event): void
{
$event->getCriteria()->getAssociation('secondMediaExtension.media');
}
}