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.  
  14.                     {% block component_product_box_rich_snippets %}
  15.                         {% deprecated '@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.                             <a href="{{ seoUrl('frontend.detail.page', {'productId': id}) }}"
  27.                                title="{{ name }}"
  28.                                class="product-image-link is-{{ displayMode }}">
  29.                                 {% if cover.url %}
  30.                                     {% set attributes = {
  31.                                         'class': 'product-image is-'~displayMode,
  32.                                         'alt': (cover.translated.alt ?: name),
  33.                                         'title': (cover.translated.title ?: name)
  34.                                     } %}
  35.                                     {% if displayMode == 'cover' or displayMode == 'contain' %}
  36.                                         {% set attributes = attributes|merge({ 'data-object-fit': displayMode }) %}
  37.                                     {% endif %}
  38.                                     {% sw_thumbnails 'product-image-thumbnails' with {
  39.                                         media: cover,
  40.                                         sizes: sizes
  41.                                     } %}
  42.                                 {% else %}
  43.                                     <div class="product-image-placeholder">
  44.                                         {% sw_icon 'placeholder' style {
  45.                                             'size': 'fluid'
  46.                                         } %}
  47.                                     </div>
  48.                                 {% endif %}
  49.                             </a>
  50.                             {% if config('core.cart.wishlistEnabled') %}
  51.                                 {% block component_product_box_wishlist_action %}
  52.                                     {% sw_include '@Storefront/storefront/component/product/card/wishlist.html.twig' with {
  53.                                         appearance: 'circle',
  54.                                         productId: id
  55.                                     } %}
  56.                                 {% endblock %}
  57.                             {% endif %}
  58.                         </div>
  59.                     {% endblock %}
  60.                     {% block component_product_box_info %}
  61.                         <div class="product-info">
  62.                             {% block component_product_box_rating %}
  63.                                 {% if config('core.listing.showReview') %}
  64.                                     <div class="product-rating">
  65.                                         {% if product.ratingAverage %}
  66.                                             {% sw_include '@Storefront/storefront/component/review/rating.html.twig' with {
  67.                                                 points: product.ratingAverage,
  68.                                                 style: 'text-primary'
  69.                                             } %}
  70.                                         {% endif %}
  71.                                     </div>
  72.                                 {% endif %}
  73.                             {% endblock %}
  74.                             {% block component_product_box_name %}
  75.                                 <a href="{{ seoUrl('frontend.detail.page', {'productId': id}) }}"
  76.                                    class="product-name"
  77.                                    title="{{ name }}">
  78.                                     {{ name }}
  79.                                 </a>
  80.                             {% endblock %}
  81.                             {% block component_product_box_variant_characteristics %}
  82.                                 <div class="product-variant-characteristics">
  83.                                     <div class="product-variant-characteristics-text">
  84.                                         {% for variation in product.variation %}
  85.                                             {{ variation.group }}:
  86.                                             <span class="product-variant-characteristics-option">
  87.                                                 {{ variation.option }}
  88.                                             </span>
  89.                                             {% if product.variation|last != variation %}
  90.                                                 {{ " | " }}
  91.                                             {% endif %}
  92.                                         {% endfor %}
  93.                                     </div>
  94.                                 </div>
  95.                             {% endblock %}
  96.                             {% block component_product_box_description %}
  97.                                 <div class="product-description">
  98.                                     {{ product.translated.description|striptags|raw }}
  99.                                 </div>
  100.                             {% endblock %}
  101.                             {% block component_product_box_price %}
  102.                                 {% sw_include '@Storefront/storefront/component/product/card/price-unit.html.twig' %}
  103.                             {% endblock %}
  104.                             {% block component_product_box_action %}
  105.                                 {% sw_include '@Storefront/storefront/component/product/card/action.html.twig' %}
  106.                             {% endblock %}
  107.                         </div>
  108.                     {% endblock %}
  109.                 </div>
  110.             {% endblock %}
  111.         </div>
  112.     {% endif %}
  113. {% endblock %}