{% extends 'layout.html.twig' %}{% block content %} {% include 'includes/breadcrumb.html.twig' %} {% set category = product.categories is iterable ? product.categories|first : false %} <section class="section-filter"> <div class="container-fluid"> <div class="row align-items-center"> <div class="col-auto"> {% if category %} <p class="h1">{{ category.name }}</p> {% endif %} </div> {# <div class="col-auto ms-auto"> <select name="" id="" class="form-select"> <option value="">Toon als thumbnails</option> </select> </div> <div class="col-auto"> <select name="" id="" class="form-select"> <option value="">Sorteer op productgroep</option> </select> </div> <div class="col-auto"> <select name="" id="" class="form-select"> <option value="">Toon aantal (9)</option> </select> </div> #} </div><!--/ .row --> </div><!--/ .container --> </section> <section class="section-products"> <div class="container-fluid"> <div class="container-inner"> <div class="row"> <div class="col-auto"> <h1 class="h2 mb-1">{{ product.name }}</h1> {% if product.onOrder %} <span class="badge bg-danger">{{ 'Op bestelling!'|trans }}</span> {% endif %} <p class="text-primary mb-5">{{ 'Code'|trans }}: {{ product.code }} — {{ 'Merk'|trans }}: {{ product.brand }} {% if product.categoryTypes %} — {{ 'Categorietype'|trans }}: {{ product.categoryTypes|map(t => t.name)|join(', ') }}{% endif %}</p> </div> <div class="col-auto ms-auto"> <favorite-button product-id="{{ product.id }}" :is-current-favorite="{{ product.id in favoriteIds ? 'true' : 'false' }}" ></favorite-button> </div> <favorite-modal></favorite-modal> </div> <div class="row"> <div class="col-lg-3"> {% if product.images %} {% set imageList = product.images|json_decode %} <div class="product-detail-images"> <!-- swiper --> <div id="detail-slider" class="swiper swiper--detail"> <div class="swiper-wrapper"> {% for photo in imageList %} <div class="swiper-slide"> <a href="{{ photo.lightboxImage }}" class="product-lightbox" data-glightbox="type: image"> <img class="img-fluid" src="{{ photo.thumbnailImage }}" alt=""> </a> </div> {% endfor %} </div> <div class="swiper-button-prev"></div> <div class="swiper-button-next"></div> </div><!--/ .swiper --> <!-- swiper --> <div class="swiper swiper--detail-thumbs" id="detail-thumbs-slider"> <div class="swiper-wrapper"> {% for photo in imageList %} <div class="swiper-slide"> <img class="img-fluid" src="{{ photo.thumbnailImage }}" alt=""> </div> {% endfor %} </div> </div><!--/ .swiper --> </div> {% else %} <div class="img-wrapper placeholder-img"> <img src="{{ asset('/img/placeholder.png') }}" alt="" class="img-fluid w-100"> </div> {% endif %} {% if product.productsheet %} <div class="row"> <div class="productsheet"> <a class="btn btn-hyperlink icon-link" href="{{ product.productsheet }}" target="_blank"> {{ 'Bekijk productfiche'|trans }} <i class="icon-link-ext"></i> </a> </div> </div><!--/ .row --> {% endif %} </div> <div class="col-lg-8 offset-lg-1"> <div class="row"> <div class="col-auto"> <div class="product-detail-price"> {% if not product.OSPrice.getAmount.isZero %} <div class="price {% if product.promoDate1 and product.promoDate2 and date(product.promoDate1) < date() and date(product.promoDate2) > date() %} price--promo {% endif %}">{{ product.OSPrice }}<small class="price-unit">/{{ product.unit }}</small> </div> {% if( product.discount ) %} {% if( product.OSPrice != product.OSDefaultPrice ) %} <p class="old-price">{{ product.OSDefaultPrice }}</p> {% endif %} <div class="promo">-{{ product.discount }}%</div> {% endif %} {% endif %} {% if product.promoDate1 and product.promoDate2 and date(product.promoDate1) < date() and date(product.promoDate2) > date() %} {# Show promo price even when prices should not show #} {% if product.OSPrice.getAmount.isZero %} {% if product.promoPrice %} <div class="price price--promo">{{ product.promoPrice | currency }} <small class="price-unit">/{{ product.unit }}</small></div> {% endif %} {% if( product.promoPercentage ) %} <div class="promo">-{{ product.promoPercentage }}%</div> {% endif %} {% endif %} <p class="date"> ({{ 'Promotie vanaf'|trans }} {{ product.promoDate1|date('d/m/Y') }} {{ 'tot'|trans }} {{ product.promoDate2|date('d/m/Y') }} )</p> {% endif %} </div> </div> <div class="col-auto ms-auto"> <add-to-cart product-id="{{ product.id }}" unit="{{ product.unit }}" minimum-unit="{{ 0 + product.unitMinimum }}" amount-in-cart="{{ cartItems[product.id] ?? 0 }}" ></add-to-cart> </div> </div><!--/ .row --> {% if product.onOrder %} {% set orderMessage = product_order_message(product) %} {% if orderMessage %} <div class="alert alert-warning d-flex align-items-start" role="alert"> <svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 16 16" fill="currentColor" class="flex-shrink-0 me-2 mt-1" aria-hidden="true"> <path d="M8 16A8 8 0 1 0 8 0a8 8 0 0 0 0 16zm.93-9.412-1 4.705c-.07.34.029.533.304.533.194 0 .487-.07.686-.246l-.088.416c-.286.346-.92.598-1.465.598-.703 0-1.002-.422-.808-1.319l.738-3.468c.064-.293.006-.399-.287-.47l-.451-.081.082-.381 2.29-.287zM8 5.5a1 1 0 1 1 0-2 1 1 0 0 1 0 2z"/> </svg> <span style="white-space: pre-wrap;">{{ orderMessage }}</span> </div> {% endif %} {% endif %} {% set default_tab = null %} <ul class="nav nav--tabs" id="nav-tab" role="tablist"> {% if product.ingredients %} {% set default_tab = 1 %} <li class="nav-item"> <button class="nav-link {{ default_tab == 1 ? 'active' : '' }}" id="nav-tab-1" data-bs-toggle="tab" data-bs-target="#tab-1" role="tab" aria-selected="true">{{ 'Ingrediënten'|trans }}</button> </li> {% endif %} {% if product.description %} {% set default_tab = default_tab ? default_tab : 2 %} <li class="nav-item"> <button class="nav-link {{ default_tab == 2 ? 'active': '' }}" id="nav-tab-2" data-bs-toggle="tab" data-bs-target="#tab-2" role="tab" aria-selected="true">{{ 'Omschrijving'|trans }}</button> </li> {% endif %} {% if product.nutrients %} {% set default_tab = default_tab ? default_tab : 3 %} <li class="nav-item"> <button class="nav-link {{ default_tab == 3 ? 'active' : '' }}" id="nav-tab-3" data-bs-toggle="tab" data-bs-target="#tab-3" role="tab" aria-selected="false">{{ 'Voedingswaarde'|trans }}</button> </li> {% endif %} {% if allergens and (allergens|length) > 0 %} {% set default_tab = default_tab ? default_tab : 4 %} <li class="nav-item"> <button class="nav-link {{ default_tab == 4 ? 'active' : '' }}" id="nav-tab-4" data-bs-toggle="tab" data-bs-target="#tab-4" role="tab" aria-selected="false">{{ 'Wettelijke allergenen'|trans }}</button> </li> {% endif %} {% if product.psinfoodDocuments %} {% set default_tab = default_tab ? default_tab : 5 %} <li class="nav-item"> <button class="nav-link {{ default_tab == 5 ? 'active' : '' }}" id="nav-tab-5" data-bs-toggle="tab" data-bs-target="#tab-5" role="tab" aria-selected="false">{{ 'Documenten'|trans }}</button> </li> {% endif %} </ul> <div class="tab-content" id="tab-content"> {% if product.ingredients %} <div class="tab-pane fade {{ default_tab == 1 ? 'show active' : '' }}" id="tab-1" aria-labelledby="nav-tab-1" role="tabpanel"> {{ product.ingredients }} </div> {% endif %} {% if product.description %} <div class="tab-pane fade {{ default_tab == 2 ? 'show active' : '' }}" id="tab-2" aria-labelledby="nav-tab-2" role="tabpanel"> {{ product.description|raw|nl2br }} </div> {% endif %} {% if product.nutrients %} <div class="tab-pane fade {{ default_tab == 3 ? 'show active' : '' }}" id="tab-3" aria-labelledby="nav-tab-3" role="tabpanel"> <table class="table"> {% for nutrient in product.nutrients|json_decode %} <tr> <td>{{ nutrient.name }}:</td> <td class="text-end">{{ nutrient.value }} {{ nutrient.unit }}</td> </tr> {% endfor %} </table> </div> {% endif %} {% if allergens %} <div class="tab-pane fade {{ default_tab == 4 ? 'show active' : '' }}" id="tab-4" aria-labelledby="nav-tab-4" role="tabpanel"> {% set counter = 0 %} {% for allergen_type in allergens %} {% if allergen_type and allergen_type.fields|length %} {% set counter = counter + 1 %} <p><strong>{{ allergen_type['title'] }}:</strong></p> <ul class="ingredients"> {% for allergen in allergen_type.fields %} <li>{{ allergen }}</li> {% endfor %} </ul> {% endif %} {% endfor %} {% if counter == 0 %} <p>{{ 'Geen allergeeninformatie beschikbaar voor dit product'|trans }}</p> {% endif %} </div> {% endif %} {% if product.psinfoodDocuments %} <div class="tab-pane fade {{ default_tab == 5 ? 'show active' : '' }}" id="tab-5" aria-labelledby="nav-tab-5" role="tabpanel"> <ul class="ingredients"> {% for document in product.psinfoodDocuments|json_decode %} <li> <a href="{{ document.downloadurl }}"> {{ document.labelname.value }} {% if document.title.value is same as('string') %} {{ document.title.value }} {% endif %} </a> </li> {% endfor %} </ul> </div> {% endif %} </div> </div> </div><!--/ .row --> </div> </div><!--/ .container-fluid --> </section>{% endblock %}