LanguageRouteRequestEvent example

$criteria = new Criteria();
        $criteria->setTitle('header::languages');

        $criteria->addFilter(
            new EqualsFilter('language.salesChannelDomains.salesChannelId', $context->getSalesChannel()->getId())
        );

        $criteria->addSorting(new FieldSorting('name', FieldSorting::ASCENDING));
        $criteria->addAssociation('productSearchConfig');
        $apiRequest = new Request();

        $event = new LanguageRouteRequestEvent($request$apiRequest$context$criteria);
        $this->eventDispatcher->dispatch($event);

        return $this->languageRoute->load($event->getStoreApiRequest()$context$criteria)->getLanguages();
    }
}
Home | Imprint | This part of the site doesn't use cookies.