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