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