vendor/dvdw/theme/src/Resources/views/storefront/component/product/card/box-standard.html.twig line 1

Open in your IDE?
  1. {% sw_extends '@Storefront/storefront/component/product/card/box-standard.html.twig' %}
  2. {% block component_product_box_content %}
  3.     {% set type = 'free' %}
  4.     {% if product.extensions.dvdwParticipations and product.extensions.dvdwParticipations.elements | length > 0 %}
  5.         {% set participation = product.extensions.dvdwParticipations | first %}
  6.         {% if participation and participation.orderLineItem and participation.orderLineItem.extensions.dvdwTicket %}
  7.             {% set type = participation.orderLineItem.extensions.dvdwTicket.type %}
  8.         {% endif %}
  9.     {% endif %}
  10.     {% set showPromoPhase = context.extensions.currentDvdwEvent.phase === 'phase-promo-show' %}
  11.     {% set usePromoPhase = context.extensions.currentDvdwEvent.phase === 'phase-promo-use' %}
  12.     <div class="card-body">
  13.         {% block component_product_box_badges %}
  14.             {{ parent() }}
  15.         {% endblock %}
  16.         {% block component_product_box_rich_snippets %}
  17.             {{ parent() }}
  18.         {% endblock %}
  19.         {% block component_product_main_container %}
  20.             <div class="product-main-container">
  21.                 {% block component_product_box_image %}
  22.                     <div class="product-image-wrapper">
  23.                         {# fallback if display mode is not set #}
  24.                         {% set displayMode = displayMode ?: 'standard' %}
  25.                         {# set display mode 'cover' for box-image with standard display mode #}
  26.                         {% if layout == 'image' and displayMode == 'standard' %}
  27.                             {% set displayMode = 'cover' %}
  28.                         {% endif %}
  29.                         <a href="{{ seoUrl('frontend.detail.page', {'productId': id}) }}"
  30.                            title="{{ name }}"
  31.                            class="product-image-link is-{{ displayMode }}">
  32.                             {% if cover.url %}
  33.                                 {% set attributes = {
  34.                                     'class': 'product-image is-'~displayMode,
  35.                                     'alt': (cover.translated.alt ?: name),
  36.                                     'title': (cover.translated.title ?: name)
  37.                                 } %}
  38.                                 {% if displayMode == 'cover' or displayMode == 'contain' %}
  39.                                     {% set attributes = attributes|merge({ 'data-object-fit': displayMode }) %}
  40.                                 {% endif %}
  41.                                 {% sw_thumbnails 'product-image-thumbnails' with {
  42.                                     media: cover,
  43.                                     sizes: sizes
  44.                                 } %}
  45.                             {% else %}
  46.                                 <div class="product-image-placeholder">
  47.                                     {% sw_icon 'placeholder-icon' style {
  48.                                         pack: 'custom-icons',
  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.                         {% endblock %}
  68.                         {% block component_product_box_name %}
  69.                             <a href="{{ seoUrl('frontend.detail.page', {'productId': id}) }}"
  70.                                class="product-name"
  71.                                title="{{ name }}">
  72.                                 <h3>{{ name }}</h3>
  73.                             </a>
  74.                         {% endblock %}
  75.                         {% block component_product_box_variant_characteristics %}
  76.                         {% endblock %}
  77.                         {% block component_product_box_categories %}
  78.                             <div class="product-categories">
  79.                                 {% if product.categories %}
  80.                                     {% sw_include '@DvdwDirectory/storefront/component/product/custom-product-category.html.twig' ignore missing with {
  81.                                         minimal: true,
  82.                                         product: product
  83.                                     } %}
  84.                                 {% endif %}
  85.                             </div>
  86.                         {% endblock %}
  87.                         {% block component_product_box_description %}
  88.                             <div class="product-description
  89.                                 {% if product.translated.description|length > 75 %} tooltip-target {% endif %}">
  90.                                 {{ product.translated.description|striptags|raw }}
  91.                             </div>
  92.                         {% endblock %}
  93.                         {% block component_product_box_price %}
  94.                         {% endblock %}
  95.                     </div>
  96.                 {% endblock %}
  97.             </div>
  98.         {% endblock %}
  99.         {% block component_product_box_line %}
  100.             <hr class="image-info-line">
  101.         {% endblock %}
  102.         {% set participation = product.extensions.dvdwParticipations.elements | first %}
  103.         {% set promotion = participation.dvdwPromotion %}
  104.         {% if (showPromoPhase or usePromoPhase ) and promotion %}
  105.             {% block component_product_box_promotion_info %}
  106.                 {% sw_include '@Storefront/storefront/page/product-detail/webshop-promotions.html.twig' ignore missing with {
  107.                     product: product,
  108.                     promotion: promotion,
  109.                     isListingView: true
  110.                 } %}
  111.             {% endblock %}
  112.         {% endif %}
  113.         {% block component_product_box_action %}
  114.             {% sw_include '@Storefront/storefront/component/product/card/action.html.twig' with {
  115.                 type: type,
  116.                 showPromoPhase: showPromoPhase,
  117.                 usePromoPhase: usePromoPhase
  118.             } %}
  119.         {% endblock %}
  120.     </div>
  121. {% endblock %}