custom/plugins/SwagEnterpriseSearchPlatform/src/Resources/views/storefront/page/search/index.html.twig line 1

Open in your IDE?
  1. {% sw_extends '@Storefront/storefront/page/search/index.html.twig' %}
  2. {% block page_search_headline %}
  3.     {{ parent() }}
  4.     {% set products = page.getSearchResult().getResultByCollectionClass('Shopware\\Core\\Content\\Product\\SalesChannel\\SalesChannelProductCollection') %}
  5.     {% if products is null %}
  6.         {% set products = page.getSearchResult().getResultByCollectionClass('Shopware\\Core\\Content\\Product\\ProductCollection') %}
  7.     {% endif %}
  8.     {% set manufacturers = page.getSearchResult().getResultByCollectionClass('Shopware\\Core\\Content\\Product\\Aggregate\\ProductManufacturer\\ProductManufacturerCollection') %}
  9.     {% set categories = page.getSearchResult().getResultByCollectionClass('Shopware\\Core\\Content\\Category\\CategoryCollection') %}
  10.     {% if manufacturers.total > 0 or categories.total > 0 %}
  11.         <div class="additional-results">
  12.             {% if categories.total > 0 %}
  13.             <div class="additional-results-row row align-top">
  14.                 <div class="sesp-result-col col-sm-6 col-lg-4 col-xl-3">
  15.                     <div class="search-result-header">
  16.                         {{ "general.categories"|trans }}
  17.                     </div>
  18.                     <ul class="suggest-product-listing">
  19.                         {% for category in categories %}
  20.                             <li>
  21.                                 {% block page_search_category_result_link %}
  22.                                     {% sw_include '@SwagEnterpriseSearch/storefront/page/search/sesp-result.html.twig' with
  23.                                         {
  24.                                             'name': category.translated.name,
  25.                                             'link': seoUrl('frontend.navigation.page', { 'navigationId': category.id})
  26.                                         }
  27.                                     %}
  28.                                 {% endblock %}
  29.                             </li>
  30.                         {% endfor %}
  31.                     </ul>
  32.                 </div>
  33.                 {% endif %}
  34.                 {% if manufacturers.total > 0 %}
  35.                     <div class="sesp-result-col col-sm-6 col-lg-4 col-xl-3">
  36.                         <div class="search-result-header">
  37.                             {{ "general.manufacturer"|trans }}
  38.                         </div>
  39.                         <ul class="suggest-product-listing">
  40.                             {% for manufacturer in manufacturers %}
  41.                                 <li>
  42.                                     {% block page_search_manufacturer_result_link %}
  43.                                         {% sw_include '@SwagEnterpriseSearch/storefront/page/search/sesp-result.html.twig' with { 'name': manufacturer.translated.name, 'link': path('frontend.search.page') ~ "?search=" ~ manufacturer.translated.name} %}
  44.                                     {% endblock %}
  45.                                 </li>
  46.                             {% endfor %}
  47.                         </ul>
  48.                     </div>
  49.                 {% endif %}
  50.             </div>
  51.         </div>
  52.     {% endif %}
  53. {% endblock %}