{% extends 'layouts/layout.html.twig' %}
{% block content %}
{% do pimcore_head_title().set(product.codice ~ " - " ~ product.categories[0].name ~ " | Busetto") %}
{% do pimcore_head_meta().setDescription(metaDescription, 160) %}
{% set breadcrumbData = product.getCategoryBreadcrumb() %}
{% set breadcrumb = "" %}
{% set prelocal = "" %}
{% set precat = "" %}
{% if breadcrumbData is not empty %}
{% if app.request.locale == 'it' %}
{% set prelocal = "/it/prodotti/" %}
{% set precat = "/ Prodotti " %}
{% elseif app.request.locale == 'en' %}
{% set prelocal = "/en/products/" %}
{% set precat = "/ Products " %}
{% endif %}
{% set breadcrumb = precat ~ '/ <a href="' ~ prelocal ~ breadcrumbData.url ~ '">' ~ breadcrumbData.name ~ '</a> ' %}
{% endif %}
<main role="main" class="single-product mt-100 pt-0 pt-lg-100">
<div class="fs-15 breadcrumbs mb-10 mx-10 mx-md-40 mx-lg-70">
<a href="/">{{ 'Home'|trans }}</a> {{ breadcrumb|raw }}/ {{ product.nome }}
</div>
{{ pimcore_areablock("areaBlock") }}
<div class="pb-20 mx-10 mx-md-40 mx-lg-70 ">
<div class="row gx-0 gx-lg-70">
<div class="col-12 col-xl-7">
<!--{# start swiper product details #}-->
<div class="d-flex flex-column flex-lg-row gallery-product">
<div class="col-12 col-lg-2 order-2 order-lg-1 my-30 my-lg-0">
<div class="swiper swiper-thumbs">
<div class="swiper-wrapper">
{% if product.fotoPricipale is not empty %}
<div class="swiper-slide thumb p-10" style="background-image:url({{ product.fotoPricipale.getThumbnail("product_thumbnail_gallery").getPath() }})">
<!-- {{ product.fotoPricipale.getThumbnail("product_thumbnail_gallery").getHtml()|raw }} -->
</div>
{% endif %}
{% if product.foto2 is not empty %}
<div class="swiper-slide thumb p-5" style="background-image:url({{ product.foto2.getThumbnail("product_thumbnail_gallery").getPath() }})">
<!-- {{ product.foto2.getThumbnail("product_thumbnail_gallery").getHtml()|raw }} -->
</div>
{% endif %}
{% if product.foto3 is not empty %}
<div class="swiper-slide thumb p-5" style="background-image:url({{ product.foto3.getThumbnail("product_thumbnail_gallery").getPath() }})">
<!-- {{ product.foto3.getThumbnail("product_thumbnail_gallery").getHtml()|raw }} -->
</div>
{% endif %}
{% if product.foto4 is not empty %}
<div class="swiper-slide thumb p-5" style="background-image:url({{ product.foto4.getThumbnail("product_thumbnail_gallery").getPath() }})">
<!-- {{ product.foto4.getThumbnail("product_thumbnail_gallery").getHtml()|raw }} -->
</div>
{% endif %}
</div>
</div>
</div>
<div class="ms-0 ms-lg-20 col-12 col-lg-10 order-1 order-lg-2 p-5 position-relative">
{% if product.url3d %}
<div class="banner3d-container">
<a href="{{ product.url3d }}" class="banner3d" target="_blank">
<span>{{ 'TEXT3D'|trans|raw }}</span>
</a>
</div>
{% endif %}
<div class="swiper swiper-slider">
<div class="swiper-wrapper">
{% if product.fotoPricipale is not empty %}
<div class="swiper-slide">
<a href="#" data-bs-toggle="modal" data-bs-target="#imageModal" data-image="{{ product.fotoPricipale.thumbnail('product_main') }}" class="d-block d-lg-none">
<div class=" position-absolute top-0 end-0"><svg xmlns="http://www.w3.org/2000/svg" width="30" height="30" fill="currentColor" class="bi bi-plus-circle" viewBox="0 0 17 17"><path d="M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14m0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16"/><path d="M8 4a.5.5 0 0 1 .5.5v3h3a.5.5 0 0 1 0 1h-3v3a.5.5 0 0 1-1 0v-3h-3a.5.5 0 0 1 0-1h3v-3A.5.5 0 0 1 8 4"/></svg></div>
</a>
{% if product.fotoPricipale.getMetadata('alt') is not null and product.fotoPricipale.getMetadata('alt') is not empty %}
{{ product.fotoPricipale.getThumbnail("product_main").getHtml()|raw }}
{% else %}
{% set alt_image = "Busetto " ~ product.codice ~ " " ~ product.descrizione|split(". ")[0] ~ " 1" %}
{{ product.fotoPricipale.thumbnail("product_main").html({'alt': alt_image})|raw }}
{% endif %}
</div>
{% endif %}
{% if product.foto2 is not empty %}
<div class="swiper-slide">
<a href="#" data-bs-toggle="modal" data-bs-target="#imageModal" data-image="{{ product.foto2.thumbnail('product_main') }}" class="d-block d-lg-none">
<div class=" position-absolute top-0 end-0"><svg xmlns="http://www.w3.org/2000/svg" width="30" height="30" fill="currentColor" class="bi bi-plus-circle" viewBox="0 0 17 17"><path d="M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14m0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16"/><path d="M8 4a.5.5 0 0 1 .5.5v3h3a.5.5 0 0 1 0 1h-3v3a.5.5 0 0 1-1 0v-3h-3a.5.5 0 0 1 0-1h3v-3A.5.5 0 0 1 8 4"/></svg></div>
</a>
{% if product.foto2.getMetadata('alt') is not null and product.foto2.getMetadata('alt') is not empty %}
{{ product.foto2.getThumbnail("product_main").getHtml()|raw }}
{% else %}
{% set alt_image = "Busetto " ~ product.codice ~ " " ~ product.descrizione|split(". ")[0] ~ " 2" %}
{{ product.foto2.thumbnail("product_main").html({'alt': alt_image})|raw }}
{% endif %}
</div>
{% endif %}
{% if product.foto3 is not empty %}
<div class="swiper-slide">
<a href="#" data-bs-toggle="modal" data-bs-target="#imageModal" data-image="{{ product.foto3.thumbnail('product_main') }}" class="d-block d-lg-none">
<div class=" position-absolute top-0 end-0"><svg xmlns="http://www.w3.org/2000/svg" width="30" height="30" fill="currentColor" class="bi bi-plus-circle" viewBox="0 0 17 17"><path d="M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14m0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16"/><path d="M8 4a.5.5 0 0 1 .5.5v3h3a.5.5 0 0 1 0 1h-3v3a.5.5 0 0 1-1 0v-3h-3a.5.5 0 0 1 0-1h3v-3A.5.5 0 0 1 8 4"/></svg></div>
</a>
{% if product.foto3.getMetadata('alt') is not null and product.foto3.getMetadata('alt') is not empty %}
{{ product.foto3.getThumbnail("product_main").getHtml()|raw }}
{% else %}
{% set alt_image = "Busetto " ~ product.codice ~ " " ~ product.descrizione|split(". ")[0] ~ " 3" %}
{{ product.foto3.thumbnail("product_main").html({'alt': alt_image})|raw }}
{% endif %}
</div>
{% endif %}
{% if product.foto4 is not empty %}
<div class="swiper-slide">
<a href="#" data-bs-toggle="modal" data-bs-target="#imageModal" data-image="{{ product.foto4.thumbnail('product_main') }}" class="d-block d-lg-none">
<div class=" position-absolute top-0 end-0"><svg xmlns="http://www.w3.org/2000/svg" width="30" height="30" fill="currentColor" class="bi bi-plus-circle" viewBox="0 0 17 17"><path d="M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14m0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16"/><path d="M8 4a.5.5 0 0 1 .5.5v3h3a.5.5 0 0 1 0 1h-3v3a.5.5 0 0 1-1 0v-3h-3a.5.5 0 0 1 0-1h3v-3A.5.5 0 0 1 8 4"/></svg></div>
</a>
{% if product.foto4.getMetadata('alt') is not null and product.foto4.getMetadata('alt') is not empty %}
{{ product.foto4.getThumbnail("product_main").getHtml()|raw }}
{% else %}
{% set alt_image = "Busetto " ~ product.codice ~ " " ~ product.descrizione|split(". ")[0] ~ " 4" %}
{{ product.foto4.thumbnail("product_main").html({'alt': alt_image})|raw }}
{% endif %}
</div>
{% endif %}
</div>
<div class="swiper-pagination"></div>
</div>
<!-- Modale per l'immagine -->
<div class="modal fade" id="imageModal" tabindex="-1" aria-labelledby="imageModalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg modal-fullscreen-lg-down modal-dialog-centered">
<div class="modal-content rounded-0">
<div class="modal-header border-0">
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body" id="modalImageContainer">
<!-- image container -->
</div>
</div>
</div>
</div>
</div>
</div>
<!--{# end swiper product details #}-->
</div>
<div class="col-12 col-xl-5 mb-30">
{% include '/inc/social-share.html.twig' %}
<h1>{{ product.nome }}</h1>
<p class="m-0">{{ product.descrizione|raw }}</p>
{% if product.tag is not empty %}
<div class="tags d-flex gap-10 mt-10">
{% for tag in product.tag %}
<span class="tag border border-deep-gray px-10 rounded-4">{{ tag.name }}</span>
{% endfor %}
</div>
{% endif %}
<div class="downloads d-flex gap-50 my-80">
{# <a href="#" class="download"><i class="fa fa-download me-10"></i>Scarica scheda tecnica</a>
<a href="#" class="download"><i class="fa fa-download me-10"></i>Scarica catalogo materiali</a> #}
</div>
{% if product.famiglia is not empty %}
<h4>{{ 'Nella stessa collezione'|trans }}</h4>
<div class="category-products d-flex gap-20">
<div class="swiper swiper-slider pb-40">
<div class="swiper-wrapper">
{% for prodotto in product.famiglia %}
<div class="swiper-slide">
<a href="{{ prodotto.url[0].slug }}" class="product text-center fs-14 col-6 col-md-3">
<div class="image p-10">
{% if prodotto.fotoPricipale is not empty %}
<!--<img src="/assets/images/temp/chairs/s035.jpg" alt="s035" class="w-100 m-auto d-block pb-20">-->
{{ prodotto.fotoPricipale.getThumbnail("product_thumbnail_family").getHtml()|raw }}
{% else %}
<img src="/busetto-placeholder.jpg" alt="" class="w-100 m-auto d-block pb-20">
{% endif %}
</div>
<span class="fw-bold d-inline-block w-100 text-center">{{ prodotto.nome }}</span>
</a>
</div>
{% endfor %}
</div>
<div class="swiper-pagination"></div>
</div>
</div>
{% endif %}
</div>
</div>
<ul class="nav nav-underline mb-3 justify-content-between justify-content-lg-start gap-lg-80 border-bottom border-light-gray" role="tablist" id="specs-tabs" style="position:relative; z-index: 1;">
<li class="nav-item" role="presentation">
<a class="h3 nav-link m-0 p-0 active" id="size-lnk" data-mdb-toggle="tab" href="#size-tab" role="tab"
aria-controls="size-tab" aria-selected="true">{{ 'Dimensioni'|trans }}</a>
</li>
{% if rivestimenti is not empty %}
<li class="nav-item" role="presentation">
<a class="h3 nav-link m-0 p-0" id="coatings-lnk" data-mdb-toggle="tab" href="#coatings-tab" role="tab"
aria-controls="coatings-tab" aria-selected="false" data-catids="{{ rivestimenti }}" data-loc="{{ app.request.locale }}">{{ 'Rivestimenti'|trans }}</a>
</li>
{% endif %}
{% if finiture is not empty %}
<li class="nav-item" role="presentation">
<a class="h3 nav-link m-0 p-0" id="finishes-lnk" data-mdb-toggle="tab" href="#finishes-tab" role="tab"
aria-controls="finishes-tab" aria-selected="false" data-catids="{{ finiture }}" data-loc="{{ app.request.locale }}">{{ 'Finiture'|trans }}</a>
</li>
{% endif %}
</ul>
<!-- Tabs navs -->
<!-- Tabs content -->
<div class="tab-content pb-40">
<div class="tab-pane fade show active" id="size-tab" role="tabpanel" aria-labelledby="size-lnk">
{% include 'product/dimensioni.html.twig' %}
</div>
<div class="tab-pane fade" id="coatings-tab" role="tabpanel" aria-labelledby="coatings-lnk">
{% include 'product/rivestimenti.html.twig' %}
</div>
<div class="tab-pane fade" id="finishes-tab" role="tabpanel" aria-labelledby="finishes-lnk">
{% include 'product/finiture.html.twig' %}
</div>
</div>
<!-- Tabs content -->
{% if product.correlati is not empty %}
<div class="row pt-40 pb-80 border-top related-products">
<h3 class="text-center">{{ 'Potrebbero interessarti'|trans }}</h3>
<div class="related-products d-flex gap-20">
<div class="swiper swiper-slider pb-40">
<div class="swiper-wrapper">
{% for prodotto in product.correlati %}
<div class="swiper-slide">
<a href="{{ prodotto.url[0].slug }}" class="product text-center fs-14 col-6 col-md-3 col-6 col-md-3">
<div class="image p-10 p-md-30">
{% if prodotto.fotoPricipale is not empty %}
<!--<img src="/assets/images/temp/chairs/s035.jpg" alt="s035" class="w-100 m-auto d-block pb-20">-->
{{ prodotto.fotoPricipale.getThumbnail("product_related").getHtml()|raw }}
{% else %}
<picture>
<img src="/busetto-placeholder.jpg" alt="" class="w-100 m-auto d-block pb-20">
</picture>
{% endif %}
</div>
<span class="fw-bold d-inline-block w-100 text-center">{{ prodotto.nome }}</span>
</a>
</div>
{% endfor %}
</div>
<div class="swiper-pagination"></div>
</div>
</div>
</div>
{% endif %}
</div>
</main>
<style>
.zoom-container {
position: relative;
overflow: auto; /* Abilita lo scrolling */
width: 100%;
height: 100%;
touch-action: auto; /* Permette il pinch-to-zoom nativo */
}
.zoom-image {
display: flex;
justify-content:center;
align-items:center;
width: 100%;
height: 100%;
max-width: none;
max-height: none;
object-fit: contain;
cursor: grab;
transform: scale(1);
transition: transform 0.2s ease;
}
</style>
{% do pimcore_head_script().appendFile(swiper_js) %}
<script>
document.addEventListener("DOMContentLoaded", (event) => {
var thumbsSwiper = new Swiper('.gallery-product .swiper-thumbs', {
slidesPerView: '4',
direction: 'horizontal',
spaceBetween: 10,
//preventClicks: false,
//preventClicksPropagation: false,
//simulateTouch: false,
pagination: {
el: '.swiper-pagination',
type: 'bullets',
clickable: true,
},
breakpoints: {
992: {
slidesPerView: 'auto',
direction: 'vertical',
spaceBetween: 20,
}
}
});
var slider = new Swiper('.gallery-product .swiper-slider', {
slidesPerView: 1,
spaceBetween: 0,
//preventClicks: false,
//preventClicksPropagation: false,
//simulateTouch: false,
thumbs: {
swiper: thumbsSwiper,
}
});
var categorySwiper = new Swiper('.category-products .swiper-slider', {
slidesPerView: 2,
spaceBetween: 20,
//preventClicks: false,
//preventClicksPropagation: false,
//simulateTouch: false,
pagination: {
el: '.swiper-pagination',
type: 'bullets',
clickable: true,
},
breakpoints: {
992: {
slidesPerView: 4,
}
}
});
var relatedSwiper = new Swiper('.related-products .swiper-slider', {
slidesPerView: 2,
spaceBetween: 20,
//preventClicks: false,
//preventClicksPropagation: false,
//simulateTouch: false,
pagination: {
el: '.swiper-pagination',
type: 'bullets',
clickable: true,
},
breakpoints: {
992: {
slidesPerView: 4,
}
}
});
const triggerTabList = document.querySelectorAll('#specs-tabs a');
triggerTabList.forEach(triggerEl => {
const tabTrigger = new bootstrap.Tab(triggerEl);
triggerEl.addEventListener('click', event => {
event.preventDefault();
tabTrigger.show();
});
});
// modal - image zoom
const modalImageContainer = document.getElementById('modalImageContainer');
document.querySelectorAll('.swiper-slide a[data-bs-toggle="modal"]').forEach(function (link) {
link.addEventListener('click', function () {
// Ottieni l'immagine dal data-attribute
const image = this.getAttribute('data-image');
const imageHtml = `<img src="${image}" alt="zoom immagine" class="zoom-image" />`;
if (imageHtml) {
// Aggiorna il contenuto del modale
modalImageContainer.innerHTML = '<div class="zoom-container">'+imageHtml+'</div>';
}
});
});
});
</script>
{% endblock %}