<?php
namespace ATNTheme\Subscriber;
use Shopware\Core\Content\Product\Events\ProductListingCriteriaEvent;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
class ListingSubscriber implements EventSubscriberInterface
{
public static function getSubscribedEvents()
{
return [
ProductListingCriteriaEvent::class => 'modifyListingCriteria',
];
}
public function modifyListingCriteria(ProductListingCriteriaEvent $event)
{
$event->getCriteria()->addAssociation('properties');
$event->getCriteria()->addAssociation('properties.group');
}
}