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