custom/plugins/KayloBasicTheme/src/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. {#
  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 %}