custom/plugins/FroshPlatformThumbnailProcessor/src/Resources/views/storefront/component/product/card/box-standard.html.twig line 1

Open in your IDE?
  1. {% sw_extends '@Storefront/storefront/component/product/card/box-standard.html.twig' %}
  2. {# We are just setting `sizes: sizes` here #}
  3. {% block component_product_box_image %}
  4.     {% if not shopware.config.FroshPlatformThumbnailProcessor.config.FixListingThumbnailSizes %}
  5.         {{ parent() }}
  6.     {% else %}
  7.         <div class="product-image-wrapper">
  8.             {# fallback if display mode is not set #}
  9.             {% set displayMode = displayMode ?: 'standard' %}
  10.             {# set display mode 'cover' for box-image with standard display mode #}
  11.             {% if layout == 'image' and displayMode == 'standard' %}
  12.                 {% set displayMode = 'cover' %}
  13.             {% endif %}
  14.             <a href="{{ seoUrl('frontend.detail.page', {'productId': id}) }}"
  15.                title="{{ name }}"
  16.                class="product-image-link is-{{ displayMode }}">
  17.                 {% if cover.url %}
  18.                     {% set attributes = {
  19.                         'class': 'product-image is-'~displayMode,
  20.                         'alt': (cover.translated.alt ?: name),
  21.                         'title': (cover.translated.title ?: name)
  22.                     } %}
  23.                     {% if displayMode == 'cover' or displayMode == 'contain' %}
  24.                         {% set attributes = attributes|merge({ 'data-object-fit': displayMode }) %}
  25.                     {% endif %}
  26.                     {% sw_thumbnails 'product-image-thumbnails' with {
  27.                         media: cover,
  28.                         sizes: sizes
  29.                     } %}
  30.                 {% else %}
  31.                     <div class="product-image-placeholder">
  32.                         {% sw_icon 'placeholder' style {
  33.                             'size': 'fluid'
  34.                         } %}
  35.                     </div>
  36.                 {% endif %}
  37.             </a>
  38.         </div>
  39.     {% endif %}
  40. {% endblock %}