custom/static-plugins/theme-base/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. {% block component_product_box_image %}
  3.     <div class="product-image-wrapper">
  4.         {# fallback if display mode is not set #}
  5.         {% set displayMode = displayMode ?: 'standard' %}
  6.         {# set display mode 'cover' for box-image with standard display mode #}
  7.         {% if layout == 'image' and displayMode == 'standard' %}
  8.             {% set displayMode = 'cover' %}
  9.         {% endif %}
  10.         <a href="{{ seoUrl('frontend.detail.page', {'productId': id}) }}"
  11.            title="{{ name }}"
  12.            class="product-image-link is-{{ displayMode }}">
  13.             {% if cover.url %}
  14.                 {% set attributes = {
  15.                     'class': 'product-image is-'~displayMode,
  16.                     'alt': (cover.translated.alt ?: name),
  17.                     'title': (cover.translated.title ?: name)
  18.                 } %}
  19.                 {% if displayMode == 'cover' or displayMode == 'contain' %}
  20.                     {% set attributes = attributes|merge({ 'data-object-fit': displayMode }) %}
  21.                 {% endif %}
  22.                 {% sw_thumbnails 'product-image-thumbnails' with {
  23.                     media: cover,
  24.                     sizes: sizes
  25.                 } %}
  26.             {% else %}
  27.                 <div class="product-image-placeholder">
  28.                     {% sw_icon 'placeholder' style {
  29.                         'size': 'fluid'
  30.                     } %}
  31.                 </div>
  32.             {% endif %}
  33.             {% if config('core.cart.wishlistEnabled') %}
  34.                 {% block component_product_box_wishlist_action %}
  35.                     {% sw_include '@Storefront/storefront/component/product/card/wishlist.html.twig' with {
  36.                         appearance: 'circle',
  37.                         productId: id
  38.                     } %}
  39.                 {% endblock %}
  40.             {% endif %}
  41.         </a>
  42.     </div>
  43. {% endblock %}