vendor/shopware/storefront/Resources/views/storefront/layout/header/search-suggest.html.twig line 7

Open in your IDE?
  1. {# @var product \Shopware\Core\Content\Product\SalesChannel\SalesChannelProductEntity #}
  2. {% block layout_search_suggest %}
  3.     <div class="search-suggest js-search-result">
  4.         {% block layout_search_suggest_container %}
  5.             <ul class="search-suggest-container">
  6.                 {% block layout_search_suggest_results %}
  7.                     {% for product in page.searchResult %}
  8.                         {% block layout_search_suggest_result_product %}
  9.                             <li class="search-suggest-product js-result">
  10.                                 {% block layout_search_suggest_result_link %}
  11.                                     <a href="{{ seoUrl('frontend.detail.page', {'productId': product.id}) }}"
  12.                                        title="{{ product.translated.name }}"
  13.                                        class="search-suggest-product-link">
  14.                                         <div class="row align-items-center {{ gridNoGuttersClass }}">
  15.                                             {% block layout_search_suggest_result_image %}
  16.                                                 <div class="col-auto search-suggest-product-image-container">
  17.                                                     {% if product.cover.media.url %}
  18.                                                         {% sw_thumbnails 'search-suggest-product-image-thumbnails' with {
  19.                                                             media: product.cover.media,
  20.                                                             sizes: {
  21.                                                                 'default': '100px'
  22.                                                             },
  23.                                                             attributes: {
  24.                                                                 'class': 'search-suggest-product-image',
  25.                                                                 'alt': (product.cover.media.translated.alt ?: ''),
  26.                                                                 'title': (product.cover.media.translated.title ?: '')
  27.                                                             }
  28.                                                         } %}
  29.                                                     {% else %}
  30.                                                         {% sw_icon 'placeholder' style {
  31.                                                             'size': 'lg'
  32.                                                         } %}
  33.                                                     {% endif %}
  34.                                                 </div>
  35.                                             {% endblock %}
  36.                                             {% block layout_search_suggest_result_name %}
  37.                                                 <div class="col search-suggest-product-name">
  38.                                                     {{ product.translated.name }}
  39.                                                 </div>
  40.                                             {% endblock %}
  41.                                             {% block layout_search_suggest_result_price %}
  42.                                                 <div class="col-auto search-suggest-product-price">
  43.                                                     {% set price = product.calculatedPrice %}
  44.                                                     {% if product.calculatedPrices.count > 0 %}
  45.                                                         {% set price = product.calculatedPrices.last %}
  46.                                                     {% endif %}
  47.                                                     {% if product.variantListingConfig.displayParent and product.parentId === null %}
  48.                                                         {% set displayFromVariants = price.unitPrice !== product.calculatedCheapestPrice.unitPrice %}
  49.                                                         {% set price = product.calculatedCheapestPrice %}
  50.                                                     {% endif %}
  51.                                                     {% set referencePrice = price.referencePrice %}
  52.                                                     {% if product.calculatedPrices.count > 1 or displayFromVariants %}
  53.                                                         {{ "listing.listingTextFrom"|trans|sw_sanitize }}
  54.                                                     {% endif %}
  55.                                                     <span class="search-suggest-product-price">
  56.                                                         {{ price.unitPrice|currency }}{{ "general.star"|trans|sw_sanitize }}
  57.                                                     </span>
  58.                                                     {% if price.referencePrice is not null %}
  59.                                                         <br><small class="search-suggest-product-reference-price">({{ price.referencePrice.price|currency }}{{ "general.star"|trans|sw_sanitize }} / {{ price.referencePrice.referenceUnit }}&nbsp;{{ price.referencePrice.unitName }})</small>
  60.                                                     {% endif %}
  61.                                                     {% if price.regulationPrice.price is not null %}
  62.                                                         <small class="search-suggest-product-list-price">{{ "general.listPricePreviously"|trans({'%price%': price.regulationPrice.price|currency }) }}{{ "general.star"|trans|sw_sanitize }}</small>
  63.                                                     {% endif %}
  64.                                                 </div>
  65.                                             {% endblock %}
  66.                                         </div>
  67.                                     </a>
  68.                                 {% endblock %}
  69.                             </li>
  70.                         {% endblock %}
  71.                     {% endfor %}
  72.                 {% endblock %}
  73.                 {% block layout_search_suggest_result_total %}
  74.                     {% if page.searchResult.total == 0 %}
  75.                         {% block layout_search_suggest_no_result %}
  76.                             <li class="search-suggest-no-result">
  77.                                 {{ "header.searchNoResult"|trans|sw_sanitize }}
  78.                             </li>
  79.                         {% endblock %}
  80.                     {% else %}
  81.                         {% block layout_search_suggest_result_total_result %}
  82.                             <li class="js-result search-suggest-total">
  83.                                 <div class="row align-items-center {{ gridNoGuttersClass }}">
  84.                                     {% block layout_search_suggest_result_total_link %}
  85.                                         <div class="col">
  86.                                             <a href="{{ path('frontend.search.page') }}?search={{ page.searchTerm }}"
  87.                                                title="{{ "header.searchAllResults"|trans|striptags }}"
  88.                                                class="search-suggest-total-link">
  89.                                                 {% sw_icon 'arrow-head-right' style { 'size': 'sm' } %}
  90.                                                 {{ "header.searchAllResults"|trans|sw_sanitize }}
  91.                                             </a>
  92.                                         </div>
  93.                                     {% endblock %}
  94.                                     {% block layout_search_suggest_result_total_count %}
  95.                                         <div class="col-auto search-suggest-total-count">
  96.                                             {{ "header.searchResults"|trans({
  97.                                                 '%count%': page.searchResult.total,
  98.                                             })|sw_sanitize }}
  99.                                         </div>
  100.                                     {% endblock %}
  101.                                 </div>
  102.                             </li>
  103.                         {% endblock %}
  104.                     {% endif %}
  105.                 {% endblock %}
  106.             </ul>
  107.         {% endblock %}
  108.     </div>
  109. {% endblock %}