{% extends '@Storefront/storefront/component/product/card/box-standard.html.twig' %}
{% block component_product_box %}
{% if product %}
{% set name = product.translated.name %}
{% set id = product.id %}
{% set cover = product.cover.media %}
{% set variation = product.variation %}
<div class="card product-box box-{{ theme_config('productListingStylesProductBoxVersion') }} box-layout-{{ layout }}">
{% block component_product_box_content %}
<div class="card-body d-flex flex-column justify-content-start">
{% block component_product_box_badges %}
{% sw_include '@parent/storefront/component/product/card/badges.html.twig' %}
{% endblock %}
{% block component_product_box_rich_snippets %}
{% sw_include '@Storefront/storefront/component/product/card/meta.html.twig' ignore missing %}
{% endblock %}
{% block component_product_box_image %}
<div class="product-image-wrapper flex-grow-0 mb-0">
{# 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': 'lazyload product-image is-'~displayMode,
'data-sizes': "{
'xs': '315px',
'sm': '315px',
'md': '427px',
'lg': '333px',
'xl': '333px'
}",
'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': '315px',
'sm': '315px',
'md': '427px',
'lg': '333px',
'xl': '333px'
},
load: false,
loadOriginalImage: true
} %}
{% else %}
<div class="product-image-placeholder">
{% sw_icon 'placeholder' style {
'size': 'fluid'
} %}
</div>
{% endif %}
</a>
{% if config('core.cart.wishlistEnabled') %}
{% block component_product_box_wishlist_action %}
{% sw_include '@Storefront/storefront/component/product/card/wishlist.html.twig' with {
appearance: 'circle',
productId: id
} %}
{% endblock %}
{% endif %}
{% block component_product_box_superdeal %}{% endblock %}
</div>
{% endblock %}
{% block component_product_box_info %}
<div class="product-info flex-grow-1 d-flex flex-column justify-content-between flex-grow-1">
{% block component_product_box_rating %}
{% if theme_config('productListingStylesProductBoxDisplayRating') %}
{% if config('core.listing.showReview') %}
<div class="product-rating">
{% if product.ratingAverage %}
{% sw_include '@Storefront/storefront/component/review/rating.html.twig' with {
points: product.ratingAverage,
style: 'text-primary'
} %}
{% endif %}
</div>
{% endif %}
{% endif %}
{% endblock %}
{% block component_product_box_manufacturer %}
{% if theme_config('productListingStylesProductBoxDisplayManufacturer') %}
<div class="product-manufacturer">
{{ product.manufacturer.translated.name }}
</div>
{% endif %}
{% endblock %}
{% block component_product_box_name %}
<a href="{{ seoUrl('frontend.detail.page', {'productId': id}) }}"
class="product-name {{ theme_config('productListingStylesProductBoxTitleFontFormat') }}"
title="{{ name }}">
{{ name }}
</a>
{% endblock %}
{% block component_product_box_variant_characteristics %}
{% if theme_config('productListingStylesProductBoxDisplayCharacteristics') and product.variation %}
<div class="product-variant-characteristics">
<div class="product-variant-characteristics-text">
{% for variation in product.variation %}
{#{{ variation.group }}:#}
<span class="product-variant-characteristics-option">
{{ variation.option }}
</span>
{% if product.variation|last != variation %}
{{ " | " }}
{% endif %}
{% endfor %}
</div>
</div>
{% endif %}
{% endblock %}
{% block component_product_box_description %}
{% if theme_config('productListingStylesProductBoxDisplayDescription') %}
<div class="product-description">
{{ product.translated.description|striptags|raw }}
</div>
{% endif %}
{% endblock %}
{% block component_product_box_price_and_action %}
{% if theme_config('productListingStylesCombinePriceAndAction') %}
<div class="flex-grow-1 d-flex flex-nowrap"><div class="product-price-info-wrapper col-auto d-flex mt-auto align-content-end flex-column pr-0 w-75">
{% endif %}
{% block component_product_box_price %}
{% if theme_config('productListingStylesProductBoxDisplayPrices') and layout == 'standard'%}
{% sw_include '@Storefront/storefront/component/product/card/price-unit.html.twig' %}
{% endif %}
{% endblock %}
{% block component_product_box_availabilty %}
{% if theme_config('productListingStylesProductBoxDisplayAvailabilty') %}
{# Preorder #}
{% if product.active and product.releaseDate and product.releaseDate|date('U') > "now"|date('U') %}
{% block box_preorder %}
<div class="product-availabilty">
{% sw_include "@parent/storefront/utilities/icon.html.twig" ignore missing with { 'name': 'fa-check', 'class': 'far'} %}
<span>{{ "oo.product.availabilty.inStock"|trans }}</span>
</div>
{% endblock %}
{# In stock #}
{% elseif product.active and product.availableStock >= product.minPurchase and product.deliveryTime %}
{% block box_in_stock %}
<div class="product-availabilty">
{% sw_include "@parent/storefront/utilities/icon.html.twig" ignore missing with { 'name': 'fa-check', 'class': 'far'} %}
<span>{{ "oo.product.availabilty.inStock"|trans }}</span>
</div>
{% endblock %}
{# Out of stock #}
{% elseif product.isCloseout and product.availableStock < product.minPurchase %}
{% block box_out_of_stock %}
<div class="product-availabilty out-of-stock">
{% sw_include "@parent/storefront/utilities/icon.html.twig" ignore missing with { 'name': 'fa-truck', 'class': 'fas'} %}
<span>{{ "oo.product.availability.outOfStock"|trans }}</span>
</div>
{% endblock %}
{# Restock #}
{% elseif product.availableStock < product.minPurchase and product.deliveryTime and product.restockTime %}
{% block box_restock %}
<div class="product-availabilty">
{% sw_include "@parent/storefront/utilities/icon.html.twig" ignore missing with { 'name': 'fa-check', 'class': 'far'} %}
<span>{{ "oo.product.availabilty.inStock"|trans }}</span>
</div>
{% endblock %}
{# Default (looks like in stock). #}
{% else %}
{% block box_default %}
<div class="product-availabilty">
{% sw_include "@parent/storefront/utilities/icon.html.twig" ignore missing with { 'name': 'fa-check', 'class': 'far'} %}
<span>{{ "oo.product.availabilty.inStock"|trans }}</span>
</div>
{% endblock %}
{% endif %}
{% endif %}
{% endblock %}
{% if theme_config('productListingStylesCombinePriceAndAction') %}
</div><div class="col-auto ml-auto align-self-end pl-0 pr-0">
{% endif %}
{% block component_product_box_action %}
{% if
(theme_config('productListingStylesProductBoxButton') != 'none' and layout != 'image') or
(theme_config('productListingStylesProductBoxImageButton') != 'none' and layout == 'image')
%}
{% sw_include '@Storefront/storefront/component/product/card/action.html.twig' %}
{% endif %}
{% endblock %}
{% if theme_config('productListingStylesCombinePriceAndAction') %}
</div></div>
{% endif %}
{% endblock %}
{% block component_product_box_siblingslider %}
{% if theme_config('productListingStylesProductBoxDisplaySiblingSlider') and layout == 'standard' %}
<div class="product-sibling-slider">
{% sw_include '@Storefront/storefront/component/product/card/sibling-slider.html.twig' %}
</div>
{% endif %}
{% endblock %}
</div>
{% endblock %}
</div>
{% endblock %}
</div>
{% endif %}
{% endblock %}