{% sw_extends '@Storefront/storefront/page/search/index.html.twig' %}
{% block page_search_headline %}
{{ parent() }}
{% set products = page.getSearchResult().getResultByCollectionClass('Shopware\\Core\\Content\\Product\\SalesChannel\\SalesChannelProductCollection') %}
{% if products is null %}
{% set products = page.getSearchResult().getResultByCollectionClass('Shopware\\Core\\Content\\Product\\ProductCollection') %}
{% endif %}
{% set manufacturers = page.getSearchResult().getResultByCollectionClass('Shopware\\Core\\Content\\Product\\Aggregate\\ProductManufacturer\\ProductManufacturerCollection') %}
{% set categories = page.getSearchResult().getResultByCollectionClass('Shopware\\Core\\Content\\Category\\CategoryCollection') %}
{% if manufacturers.total > 0 or categories.total > 0 %}
<div class="additional-results">
{% if categories.total > 0 %}
<div class="additional-results-row row align-top">
<div class="sesp-result-col col-sm-6 col-lg-4 col-xl-3">
<div class="search-result-header">
{{ "general.categories"|trans }}
</div>
<ul class="suggest-product-listing">
{% for category in categories %}
<li>
{% block page_search_category_result_link %}
{% sw_include '@SwagEnterpriseSearch/storefront/page/search/sesp-result.html.twig' with
{
'name': category.translated.name,
'link': seoUrl('frontend.navigation.page', { 'navigationId': category.id})
}
%}
{% endblock %}
</li>
{% endfor %}
</ul>
</div>
{% endif %}
{% if manufacturers.total > 0 %}
<div class="sesp-result-col col-sm-6 col-lg-4 col-xl-3">
<div class="search-result-header">
{{ "general.manufacturer"|trans }}
</div>
<ul class="suggest-product-listing">
{% for manufacturer in manufacturers %}
<li>
{% block page_search_manufacturer_result_link %}
{% sw_include '@SwagEnterpriseSearch/storefront/page/search/sesp-result.html.twig' with { 'name': manufacturer.translated.name, 'link': path('frontend.search.page') ~ "?search=" ~ manufacturer.translated.name} %}
{% endblock %}
</li>
{% endfor %}
</ul>
</div>
{% endif %}
</div>
</div>
{% endif %}
{% endblock %}