{% sw_extends "@CrehlerMojeBambinoEngine/storefront/page/product-detail/index.html.twig" %}
{% block page_product_detail_main %}
{% set isArrangement = page.product.extensions.arrangement ?? false %}
{% set isInspiration = page.product.extensions.inspiration ?? false %}
{% if isArrangement or isInspiration %}
{% set gridMedia = isArrangement ? "col-lg-12" : "col-lg-7" %}
{% set gridBuy = isArrangement ? "col-lg-12" : "col-lg-5" %}
{% set mediaItems = page.product.extensions.arrangement.media.media ?? page.product.extensions.inspiration.media.media %}
<div class="row product-detail-main {{ isArrangement ? "is--arrangement" : "is--inspiration" }}">
<div class="{{ gridMedia }} product-detail-media product-detail-arrangement-media">
{% if mediaItems %}
{% sw_include '@CrehlerArrangements/storefront/element/cms-element-image-gallery-arrangement.html.twig' with {
'mediaItems': mediaItems,
'zoom': false,
'zoomModal': false,
'displayMode': 'contain',
'gutter': 5,
'navigationArrows': 'inside',
'navigationDots': 'inside',
'galleryPosition': 'underneath',
'isProduct': true,
'fallbackImageTitle': page.product.translated.name,
'startIndexThumbnails': page.product.extensions.arrangement.cover.position ?? page.product.extensions.inspiration.cover.position ,
'startIndexSlider': page.product.extensions.arrangement.cover.position ?? page.product.extensions.inspiration.cover.position,
'arrangementDots': page.product.extensions.arrangement.media.dots
} %}
{% endif %}
</div>
<div class="{{ gridBuy }} product-detail-arrangement-buy">
{% sw_include '@CrehlerArrangements/storefront/page/product-detail/buy-widget-arrangement.html.twig' %}
{% if isInspiration %}
<div class="product-detail-tabs is--inspiration">
{% sw_include '@CrehlerArrangements/storefront/page/product-detail/tabs-arrangement.html.twig' with {'additionalDescription': false} %}
</div>
{% endif %}
</div>
</div>
{% else %}
{{ parent() }}
{% endif %}
{% endblock %}
{% block page_product_detail_tabs %}
{% set isArrangement = page.product.extensions.arrangement ?? false %}
{% set isInspiration = page.product.extensions.inspiration ?? false %}
{% if isArrangement or isInspiration %}
<div class="product-detail-tabs{% if isInspiration and page.product.extensions.inspiration.translated.shortDescription is empty %} d-none{% endif %}">
{% sw_include '@CrehlerArrangements/storefront/page/product-detail/tabs-arrangement.html.twig' with {'additionalDescription': true} %}
</div>
<div class="product-detail-tabs product-detail-arrangement-items">
<div class="tab-pane">
<div class="arrangement-list-product">
<div class="card">
<div class="card-body">
<div class="cart-item cart-item-product cart-item-product-one">
<div class="row cart-item-row">
<div class="col-12 col-lg col-xl cart-item-info">
<div class="h3 mb-0">{{ "plugin.crehlerArrangements.productDetailTabs.valueSet"|trans|raw }}</div>
</div>
<div class="col-12 col-sm col-md cart-item-unit-price text-center text-sm-right d-block">
<p class="price-box">{{ page.product.calculatedPrice.unitPrice|currency }}</p>
<p class="notice-text">{{ "plugin.crehlerArrangements.productDetailTabs.notice"|trans|raw }}</p>
</div>
<div class="col-12 col-md-4 col-lg-3 cart-item-add">
{# @var product \Shopware\Core\Content\Product\SalesChannel\SalesChannelProductEntity #}
<form action="{{ path('frontend.checkout.line-item.add') }}"
id="buy-widget[{{ page.product.id }}]"
method="post"
class="buy-widget"
data-add-all-to-cart="true">
{{ sw_csrf('frontend.checkout.line-item.add') }}
<input type="hidden"
name="redirectTo"
value="frontend.cart.offcanvas"/>
<button class="btn btn-primary btn-block btn-buy"
title="{{ "plugin.crehlerArrangements.productDetailTabs.buyAllButton"|trans }}"
aria-label="Kup wszystko">
<span class="label">{{ "plugin.crehlerArrangements.productDetailTabs.buyAllButton"|trans }}</span>
{% sw_icon 'bag-add' %}
</button>
</form>
</div>
<div class="col-8"></div>
{% if context.extension('shoppingLists').elements|keys[0] %}
<div class="col-md-4 add-all-to-shopping-list-wrapper" style="margin-top: 15px; padding: 0;">
<a class="btn btn-primary btn-block btn-buy add-all-to-shopping-list"
title="{{ "plugin.crehlerArrangements.productDetailTabs.buyAllButton"|trans }}"
href="{{ seoUrl('frontend.shopping-list.page.addAll', { 'arrangementId': isArrangement.id,'shoppingListId': context.extension('shoppingLists').elements|keys[0] }) }}"
aria-label="Dodaj wszystko do listy zakupowej">
<span class="label">Dodaj wszystko do listy zakupowej</span>
</a>
</div>
{% endif %}
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="product-detail-tabs product-detail-arrangement-items">
<div class="tab-pane fade show "
id="arrangement-tab-pane"
role="tabpanel"
aria-labelledby="description-tab">
<div class="arrangement-list-product">
<div class="h3">{{ "plugin.crehlerArrangements.productDetailTabs.listItemsHeadline"|trans|raw }}</div>
{% block shopping_list_index_table_container %}
<div class="card">
<div class="card-body">
{% block shopping_list_index_table_items %}
{% if isArrangement %}
{% set products = page.product.extensions.arrangement.arrangementProducts %}
{% else %}
{% set products = page.product.extensions.inspiration.inspirationProducts %}
{% endif %}
{% for listItem in products %}
{% block shopping_list_index_table_item %}
{% sw_include '@CrehlerArrangements/storefront/page/product-detail/arrangement-products-list/arrangement-products-list-item.html.twig' with {
lineItem: listItem
} %}
{% endblock %}
{% endfor %}
{% endblock %}
</div>
</div>
{% endblock %}
</div>
</div>
</div>
{% else %}
{{ parent() }}
{% endif %}
{% endblock %}