vendor/shopware/storefront/Resources/views/storefront/component/product/card/box-standard.html.twig line 1

Open in your IDE?
  1. {% block component_product_box %}
  2.     {% if product %}
  3.         {% set name = product.translated.name %}
  4.         {% set id = product.id %}
  5.         {% set cover = product.cover.media %}
  6.         {% set variation = product.variation %}
  7.         <div class="card product-box box-{{ layout }}">
  8.             {% block component_product_box_content %}
  9.                 <div class="card-body">
  10.                     {% block component_product_box_badges %}
  11.                         {% sw_include '@Storefront/storefront/component/product/card/badges.html.twig' %}
  12.                     {% endblock %}
  13.                     {% block component_product_box_rich_snippets %}
  14.                         {# @deprecated tag:v6.5.0 - Block will be removed completely including the template it references #}
  15.                         {% sw_include '@Storefront/storefront/component/product/card/meta.html.twig' %}
  16.                     {% endblock %}
  17.                     {% block component_product_box_image %}
  18.                         <div class="product-image-wrapper">
  19.                             {# fallback if display mode is not set #}
  20.                             {% set displayMode = displayMode ?: 'standard' %}
  21.                             {# set display mode 'cover' for box-image with standard display mode #}
  22.                             {% if layout == 'image' and displayMode == 'standard' %}
  23.                                 {% set displayMode = 'cover' %}
  24.                             {% endif %}
  25.                             <a href="{{ seoUrl('frontend.detail.page', {'productId': id}) }}"
  26.                                title="{{ name }}"
  27.                                class="product-image-link is-{{ displayMode }}">
  28.                                 {% if cover.url %}
  29.                                     {% set attributes = {
  30.                                         'class': 'product-image is-'~displayMode,
  31.                                         'alt': (cover.translated.alt ?: name),
  32.                                         'title': (cover.translated.title ?: name)
  33.                                     } %}
  34.                                     {% if displayMode == 'cover' or displayMode == 'contain' %}
  35.                                         {% set attributes = attributes|merge({ 'data-object-fit': displayMode }) %}
  36.                                     {% endif %}
  37.                                     {% sw_thumbnails 'product-image-thumbnails' with {
  38.                                         media: cover,
  39.                                         sizes: sizes
  40.                                     } %}
  41.                                 {% else %}
  42.                                     <div class="product-image-placeholder">
  43.                                         {% sw_icon 'placeholder' style {
  44.                                             'size': 'fluid'
  45.                                         } %}
  46.                                     </div>
  47.                                 {% endif %}
  48.                             </a>
  49.                             {% if config('core.cart.wishlistEnabled') %}
  50.                                 {% block component_product_box_wishlist_action %}
  51.                                     {% sw_include '@Storefront/storefront/component/product/card/wishlist.html.twig' with {
  52.                                         appearance: 'circle',
  53.                                         productId: id
  54.                                     } %}
  55.                                 {% endblock %}
  56.                             {% endif %}
  57.                         </div>
  58.                     {% endblock %}
  59.                     {% block component_product_box_info %}
  60.                         <div class="product-info">
  61.                             {% block component_product_box_rating %}
  62.                                 {% if config('core.listing.showReview') %}
  63.                                     <div class="product-rating">
  64.                                         {% if product.ratingAverage %}
  65.                                             {% sw_include '@Storefront/storefront/component/review/rating.html.twig' with {
  66.                                                 points: product.ratingAverage,
  67.                                                 style: 'text-primary'
  68.                                             } %}
  69.                                         {% endif %}
  70.                                     </div>
  71.                                 {% endif %}
  72.                             {% endblock %}
  73.                             {% block component_product_box_name %}
  74.                                 <a href="{{ seoUrl('frontend.detail.page', {'productId': id}) }}"
  75.                                    class="product-name"
  76.                                    title="{{ name }}">
  77.                                     {{ name }}
  78.                                 </a>
  79.                             {% endblock %}
  80.                             {% block component_product_box_variant_characteristics %}
  81.                                 <div class="product-variant-characteristics">
  82.                                     <div class="product-variant-characteristics-text">
  83.                                         {% for variation in product.variation %}
  84.                                             {{ variation.group }}:
  85.                                             <span class="product-variant-characteristics-option">
  86.                                                 {{ variation.option }}
  87.                                             </span>
  88.                                             {% if product.variation|last != variation %}
  89.                                                 {{ " | " }}
  90.                                             {% endif %}
  91.                                         {% endfor %}
  92.                                     </div>
  93.                                 </div>
  94.                             {% endblock %}
  95.                             {% block component_product_box_description %}
  96.                                 <div class="product-description">
  97.                                     {{ product.translated.description|striptags|raw }}
  98.                                 </div>
  99.                             {% endblock %}
  100.                             {% block component_product_box_price %}
  101.                                 {% sw_include '@Storefront/storefront/component/product/card/price-unit.html.twig' %}
  102.                             {% endblock %}
  103.                             {% block component_product_box_action %}
  104.                                 {% sw_include '@Storefront/storefront/component/product/card/action.html.twig' %}
  105.                             {% endblock %}
  106.                         </div>
  107.                     {% endblock %}
  108.                 </div>
  109.             {% endblock %}
  110.         </div>
  111.     {% endif %}
  112. {% endblock %}