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