{% if product %}
{% set name = product.translated.name %}
{% set id = product.id %}
{% set cover = product.cover.media %}
<div class="box-{{ layout }} col-12">
{% block component_product_box_content %}
<div class="card-body row">
{% block component_product_box_badges %}
{% sw_include '@Storefront/storefront/component/product/card/badges.html.twig' %}
{% endblock %}
{% block component_product_box_rich_snippets %}
{% sw_include '@Storefront/storefront/component/product/card/meta.html.twig' %}
{% endblock %}
{% if product.translated.customFields.wndev_motion_image %}
<div class="product-motion-image-wrapper col-4 col-sm-6 col-md-3 p-0">
{% set motionImageID = product.translated.customFields.wndev_motion_image %}
{# fetch media as batch - optimized for performance #}
{% set mediaCollection = searchMedia([motionImageID], context.context) %}
{# extract single media object #}
{% set motionImage = mediaCollection.get(motionImageID) %}
{% sw_thumbnails 'navigation-flyout-teaser-image-thumbnails' with {
media: motionImage,
attributes: {
'class': 'product-motion-image',
'alt': (motionImage.alt ?: ''),
'title': (motionImage.title ?: ''),
'data-object-fit': 'cover'
}
} %}
</div>
{% endif %}
{% block component_product_box_image %}
<div class="product-image-wrapper col-8 col-sm-6 col-md-3 d-flex">
{# fallback if display mode is not set #}
{% set displayMode = displayMode ?: 'standard' %}
{# set display mode 'cover' for box-image with standard display mode #}
{% if layout == 'image' and displayMode == 'standard' %}
{% set displayMode = 'cover' %}
{% endif %}
<a href="{{ seoUrl('frontend.detail.page', {'productId': id}) }}"
title="{{ name }}"
class="product-image-link is-{{ displayMode }}">
{% if cover.url %}
{% set attributes = {
'class': 'product-image is-'~displayMode,
'alt': (cover.translated.alt ?: name),
'title': (cover.translated.title ?: name)
} %}
{% if displayMode == 'cover' or displayMode == 'contain' %}
{% set attributes = attributes|merge({ 'data-object-fit': displayMode }) %}
{% endif %}
{% sw_thumbnails 'product-image-thumbnails' with {
media: cover,
sizes: {
'xs': '501px',
'sm': '315px',
'md': '427px',
'lg': '333px',
'xl': '284px'
}
} %}
{% else %}
<div class="product-image-placeholder">
{% sw_icon 'placeholder' style {
'size': 'fluid'
} %}
</div>
{% endif %}
</a>
</div>
{% endblock %}
{% block component_product_box_info %}
<div class="product-info col-12 col-md-6">
{% block component_product_box_name %}
<a href="{{ seoUrl('frontend.detail.page', {'productId': id}) }}"
class="product-name"
title="{{ name }}">
{{ name }}
</a>
{% endblock %}
<div class="row">
{% if product.translated.customFields.wndev_listing_text %}
<div class="sub-title-wrapper col-12">
<p class="sub-title m-0">{{ product.translated.customFields.wndev_listing_text }}</p>
</div>
{% endif %}
{% if product.translated.customFields.wndev_listing_custom_list %}
<div class="custom-listing-list-wrapper d-none d-sm-block col-12">
{{ product.translated.customFields.wndev_listing_custom_list|raw }}
</div>
{% endif %}
</div>
<div class="row">
{% if product.translated.customFields.wndev_vlog_badge %}
<div class="col-6">
<div class="vlog-badge-wrapper">
{% set VlogBadgeID = product.translated.customFields.wndev_vlog_badge %}
{# fetch media as batch - optimized for performance #}
{% set mediaCollection = searchMedia([VlogBadgeID], context.context) %}
{# extract single media object #}
{% set VlogBadge = mediaCollection.get(VlogBadgeID) %}
{% sw_thumbnails 'vlog-badge-listing' with {
media: VlogBadge,
attributes: {
'class': 'vlog-badge-image',
'alt': (VlogBadge.alt ?: ''),
'title': (VlogBadge.title ?: ''),
'data-object-fit': 'cover'
}
} %}
</div>
</div>
{% endif %}
<div class="col-6 col-lg-12">
<div class="product-action text-right text-lg-left">
<a href="{{ seoUrl('frontend.detail.page', {'productId': id}) }}"
class="btn btn-primary"
title="{{ "listing.boxProductDetails"|trans|striptags }}">
{{ "listing.boxProductDetails"|trans|sw_sanitize }}
</a>
</div>
</div>
</div>
</div>
{% endblock %}
</div>
{% endblock %}
</div>
{% endif %}