{% sw_extends '@Storefront/storefront/page/product-detail/index.html.twig' %}
{% block page_product_detail_headline %}
{% endblock %}
{% block page_product_detail_media %}
{% if page is defined and page.product is defined %}
{% set product = page.product %}
{% endif %}
{#
{% if product.isCloseout and product.availableStock < product.minPurchase %}
<span class="clerk"
data-template="@a-hnliche-produkte"
data-products='["{{ page.product.id }}"]' ></span>
{% endif %}
#}
<div class="col-lg-8 product-detail-media">
{% if page.product.media %}
{% sw_include '@Storefront/storefront/element/cms-element-image-gallery.html.twig' with {
'mediaItems': mediaItems,
'zoom': true,
'zoomModal': true,
'displayMode': 'contain',
'gutter': 30,
'minHeight': '430px',
'navigationArrows': 'inside',
'navigationDots': 'inside',
'galleryPosition': 'left',
'isProduct': true,
'fallbackImageTitle': page.product.translated.name,
'startIndexThumbnails': 1,
'startIndexSlider': 1,
'keepAspectRatioOnZoom': false,
'product': page.product
} %}
{% endif %}
</div>
{% endblock %}
{% block page_product_detail_buy %}
<div class="col-lg-4 product-detail-buy">
{% sw_include '@Storefront/storefront/page/product-detail/buy-widget.html.twig' %}
</div>
{% endblock %}
{% block page_product_detail_tabs %}
<div class="row">
<div class="product-detail-tabs col-lg-8">
{% sw_include '@Storefront/storefront/page/product-detail/tabs.html.twig' %}
</div>
<div class="product-detail-beef-club col-lg-4">
{% sw_include '@Storefront/storefront/component/doncarne-beef-club.html.twig' %}
</div>
</div>
{# custom fields will be displayed here as fake cms element. Customer does not want to handle this in CMS but fill via PIM #}
{# order always the same, only appears if custom fields there of course #}
{% set customFields = page.product.customFields %}
{# 1. expert #}
{% if customFields.migration_DonMigrate_product_dc_commentary %}
{% set expertContent = customFields.migration_DonMigrate_product_dc_commentary|customFieldJsonDecode %}
{% sw_include '@Storefront/solution360/product-detail/custom-fields-cms-mapping/expert.html.twig' with {expertContent: expertContent} %}
{% endif %}
{# 1.5 clerk #}
{% sw_include '@Storefront/doncarne/product-detail/clerk-reco.html.twig' %}
{# 2. zubereitungsempfehlung #}
{% if customFields.migration_DonMigrate_product_dc_preparation %}
{% set preparationContent = customFields.migration_DonMigrate_product_dc_preparation|customFieldJsonDecode %}
{% sw_include '@Storefront/solution360/product-detail/custom-fields-cms-mapping/preparation.html.twig' with {preparationContent: preparationContent} %}
{% endif %}
{# 3. seo image and texts, variable length #}
{% if customFields.migration_DonMigrate_product_dc_stories %}
{% set storiesContent = customFields.migration_DonMigrate_product_dc_stories|customFieldJsonDecode %}
{% sw_include '@Storefront/solution360/product-detail/custom-fields-cms-mapping/stories.html.twig' with {storiesContent: storiesContent} %}
{% endif %}
{% endblock %}
{# 4. cross selling #}
{% block page_product_detail_cross_selling %}
{% if page.crossSellings.elements is defined and page.crossSellings.elements|filter(item => item.total > 0)|length > 0 %}
<div class="product-detail-custom-cross-selling cms-block-cross-selling">
{% sw_include '@Storefront/storefront/page/product-detail/cross-selling/tabs.html.twig' with {
crossSellings: page.crossSellings
} %}
</div>
{% endif %}
{# recipe ideas #}
{% sw_include '@Storefront/solution360/product-detail/custom-fields-cms-mapping/recipe-ideas.html.twig' with {customFields: page.product.customFields} %}
{# 6. toggle info nutrion info etc #}
{% sw_include '@Storefront/solution360/product-detail/custom-fields-cms-mapping/accordion.html.twig' with {customFields: page.product.customFields} %}
{% endblock %}