1 2<!doctype html> 3<html lang="it"> 4<head> 5 <meta charset="UTF-8"> 6 <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"> 7 <meta http-equiv="X-UA-Compatible" content="ie=edge"> 8 9 10 11 <title>Checkout</title> 12 13 14 <!-- Bootstrap CSS --> 15 <link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-sRIl4kxILFvY47J16cr9ZwB07vP4J8+LH7qKQnuqkuIAvNWLzeN8tE5YBujZqJLB" crossorigin="anonymous"> 16 <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.min.css" integrity="sha384-CK2SzKma4jA5H/MXDUU7i1TqZlCFaD4T01vtyDFvPlD97JQyS+IsSh1nI2EFbpyk" crossorigin="anonymous"> 17 18 <!-- Swiper CSS --> 19 <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/swiper@12/swiper-bundle.min.css" integrity="sha384-+eoVPirEHy8XSrf7sRozx+2OTKCWm1qfVFWnQ7qiXW6vAb+GUXRw4gq7sU+hq6HG" crossorigin="anonymous"> 20 21 <!-- CSS --> 22 <link rel="stylesheet" type="text/css" href="/inc/css/style.css"> 23 <link rel="stylesheet" type="text/css" href="/inc/custom/css/loader.css"> 24 25 <link rel="stylesheet" href="/inc/css/checkout.css?v=eiv3-cSg8mmk0hOu-JIDiN9c9zWVtWpjRdR2vytQawQ" /> 26 27 28 <!-- HTMX --> 29
29<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/htmx.min.js" integrity="sha384-/TgkGk7p307TH7EXJDuUlgG3Ce1UVolAOFopFekQkkXihi5u/6OCvVKyz1W+idaz" crossorigin="anonymous"></script>
29 30 31 32 33 34
34<script async src="https://cfaddacom.api.useinsider.com/ins.js?id=10012693"></script>
34 35 36 37
37<script> 38 window.dataLayer = window.dataLayer || []; 39 dataLayer.push({"event":"traffic_type","traffic_type":"external"}); 40 </script>
40 41 42 43
44<script type="text/javascript"> 45 window.InsiderQueue = window.InsiderQueue || []; 46 window.insiderData = {}; 47</script>
47 48
49<script type="text/javascript"> 50 51 window.insiderData.checkout = {"type": "checkout"}; 52 53 54 window.addEventListener('UC_UI_INITIALIZED', function (event) { 55 try { 56 // Creiamo una variabile globale per lo stato del consenso 57 window.useinsiderConsent = false; 58 59 // Funzione per verificare il consenso e fare il push 60 function checkUseinsiderConsent() { 61 const services = UC_UI.getServicesBaseInfo(); 62 const useinsiderService = services.find(s => 63 s.name.toLowerCase() === 'useinsider' || 64 s.name.toLowerCase() === 'use insider' 65 ); 66 67 if (useinsiderService) { 68 69 //window.useinsiderConsent = UC_UI.areAllConsentsAccepted(); 70 window.useinsiderConsent = useinsiderService.consent.status; 71 72 console.log('Stato consenso Useinsider aggiornato:', window.useinsiderConsent); 73 74 // Esegui il push solo quando abbiamo un valore definito per useinsiderConsent 75 window.insiderData.user = { 76 type: 'user', value: { 77 "uuid": "", 78 "birthday": "", 79 "gdpr_optin": window.useinsiderConsent, 80 "username": "", 81 "email": "", 82 "email_optin": false, 83 "phone_number": "", 84 "language": "it_IT" 85 } 86 }; 87 } else { 88 console.error('Servizio Useinsider non trovato nella lista dei servizi'); 89 window.useinsiderConsent = false; 90 } 91 } 92 93 checkUseinsiderConsent(); 94 document.addEventListener('consent_status_change', checkUseinsiderConsent); 95 document.addEventListener('consentStatusChanged', checkUseinsiderConsent); 96 document.addEventListener('ucEvent', function (e) { 97 if (e.detail && 98 (e.detail.action === 'ACCEPT_ALL_CONSENTS' || 99 e.detail.action === 'DENY_ALL_CONSENTS' || 100 e.detail.action === 'SAVE_CONSENTS')) { 101 console.log('Evento consenso rilevato:', e.detail.action); 102 checkUseinsiderConsent(); 103 } 104 }); 105 106 } catch (e) { 107 console.error('Errore nella verifica del consenso Useinsider:', e); 108 window.useinsiderConsent = false; 109 } 110 }); 111 112</script>
112 113 114 115 116
116<script> 117 var _mtm = window._mtm = window._mtm || []; 118 _mtm.push({ 'mtm.startTime': (new Date().getTime()), 'event': 'mtm.Start' }); 119 (function() { 120 var d = document, g = d.createElement('script'), s = d.getElementsByTagName('script')[0]; 121 g.async = true; 122 g.src = 'https://mtm-cfadda.sitengine.it/js/container_A936wU59.js'; 123 s.parentNode.insertBefore(g, s); 124 })(); 125 </script>
125 126 127 128 <meta name="htmx-config" content='{"selfRequestsOnly":false,"allowScriptTags":true,"historyCacheSize":10,"withCredentials":false,"defaultFocusScroll":false,"getCacheBusterParam":false,"globalViewTransitions":false,"antiForgery":{"formFieldName":"__RequestVerificationToken","headerName":"RequestVerificationToken","requestToken":"CfDJ8Fc0ivbNY7FGjFHBPjmUdBVg7HbZwXlxnCUJaNVxdL38pIOZ0oDVkGnHszGiyAIbQ-t6KlunFiNAlfNZK04gCPjNTsG2g71eJ63igoHMRmAQWGQVrRJ_uwROzHwjS6bjZnv4QW6kkguo6rV218g-_tE"}}' /> 129 <!-- Google Tag Manager --> 130<!--
130<script type="text/javascript"> 131 var UC_READY = false; 132 // Questo evento è sollevato da usercentrics quando è pienamente caricato ed operativo 133 window.addEventListener('UC_UI_INITIALIZED', function (event) { 134 UC_READY = true; 135 (function (w, d, s, l, i) { 136 w[l] = w[l] || []; 137 w[l].push({ 138 'gtm.start': new Date().getTime(), 139 event: 'gtm.js', 140 }); 141 var f = d.getElementsByTagName(s)[0], 142 j = d.createElement(s), 143 dl = l != 'dataLayer' ? '&l=' + l : ''; 144 j.async = true; 145 j.src = 'https://www.googletagmanager.com/gtm.js?id=' + i + dl; 146 f.parentNode.insertBefore(j, f); 147 })(window, document, 'script', 'dataLayer', 'GTM-KZ2B24C'); 148 }); 149</script>
149--> 150<!-- End Google Tag Manager -->
151<script type="application/ld+json"> 152{ 153 "@context": "https://schema.org", 154 "@graph": [ 155 { 156 "@type": "WebSite", 157 "url": "https://www.cfadda.com/", 158 "potentialAction": { 159 "@type": "SearchAction", 160 "target": { 161 "@type": "EntryPoint", 162 "urlTemplate": "https://www.cfadda.com/prodotti/ricerca-prodotti?libera={libera}" 163 }, 164 "query-input": { 165 "@type": "PropertyValueSpecification", 166 "valueName": "q", 167 "defaultValue": "http://schema.org/True" 168 } 169 } 170 }, 171 { 172 "@type": "Organization", 173 "url": "https://www.cfadda.com/", 174 "logo": "https://www.cfadda.com/images/cafadda.jpg", 175 "name": "Cfadda", 176 "description": "Scopri la qualità e la convenienza del negozio online CFadda, specializzato nel Fai da te: arredamento, casa, giardinaggio, bricolage, climatizzazione e molto altro... tutto a tua disposizione!", 177 "contactPoint": [ 178 { 179 "@type": "ContactPoint", 180 "telephone": "+33070520422", 181 "contactType": "customer service" 182 } 183 ] 184 } 185 ] 186} 187</script>
187 188 189</head> 190<body> 191 192 <!-- Google Tag Manager (noscript) --> 193<!--
vendor: 68 bytes, line 193
193 <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=
193GTM-PJMMZKL
vendor: 82 bytes, line 193
193" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
193--> 194<!-- End Google Tag Manager (noscript) --> 195 196 197 198 <header class="header py-4"> 199 <div class="container"> 200 <a href="/" class="logo"> 201 <img class="img-fluid" src="/inc/img/logo-white.webp" alt="Logo" width="200" height="50"> 202 </a> 203 </div> 204</header> 205 206 207 208 209 210 211<section class="checkout my-5"> 212 <div class="container"> 213 <h1 class="font-32 text-uppercase color-blue fw-bold mb-4">Conferma ordine</h1> 214 <div class="row flex-column-reverse flex-lg-row g-4 g-lg-5"> 215 <div class="col-lg-7"> 216 <div class="checkout-login mb-5"> 217 <!-- Start - Guest --> 218 <div class="social-login"> 219 <a href="https://accounts.google.com/o/oauth2/auth?response_type=code&access_type=online&client_id=305690913870-ov4mgsd9v79bomdq3r1spdcvgthm5r4q.apps.googleusercontent.com&redirect_uri=https%3A%2F%2Fwww.cfadda.com%2Fecomm%2Fgoogle_login.php&state=from%3Dcheckout&scope=email%20profile&approval_prompt=auto" 220 class="btn-social-login btn-google"> 221 <svg xmlns="http://www.w3.org/2000/svg" width="18.53" height="18.53"
222 viewBox="0 0 18.53 18.53"> 223 <path fill="#fbbb00" 224 d="m4.1 11.2-.64 2.4-2.36.06A9.28 9.28 0 0 1 1.04 5l2.1.39.91 2.09a5.53 5.53 0 0 0 .06 3.72Z" 225 data-name="Tracciato 8"></path> 226 <path fill="#518ef8" 227 d="M18.37 7.53a9.26 9.26 0 0 1-3.3 8.96l-2.65-.13-.37-2.34a5.52 5.52 0 0 0 2.37-2.82H9.47V7.54h8.9Z" 228 data-name="Tracciato 9"></path> 229 <path fill="#28b446" 230 d="M15.06 16.49A9.27 9.27 0 0 1 1.1 13.65l3-2.45a5.51 5.51 0 0 0 7.94 2.82Z" 231 data-name="Tracciato 10"></path> 232 <path fill="#f14336" 233 d="m15.18 2.13-3 2.46a5.5 5.5 0 0 0-8.12 2.88L1.04 5a9.27 9.27 0 0 1 14.14-2.87Z" 234 data-name="Tracciato 11"></path> 235 </svg> 236 Accedi con Google 237 </a> 238 <a href="https://appleid.apple.com/auth/authorize?response_type=code&response_mode=form_post&client_id=live.cm.cfadaa.services&redirect_uri=https%3A%2F%2Fwww.cfadda.com%2Fapple-login-redirect.php&state=from%3Dcheckout&scope=name+email" 239 class="btn-social-login btn-apple"> 240 <svg xmlns="http://www.w3.org/2000/svg" width="16.3" height="20" viewBox="0 0 16.3 20"> 241 <path d="M5 20a3.64 3.64 0 0 1-2.1-1.38A11.8 11.8 0 0 1 0 11.67v-.85a5.55 5.55 0 0 1 2.56-4.6 4.48 4.48 0 0 1 2.9-.64 7.53 7.53 0 0 1 1.43.38 4.06 4.06 0 0 0 1.42.41 3.57 3.57 0 0 0 1-.29 6.38 6.38 0 0 1 3.2-.54 4.49 4.49 0 0 1 3.27 1.86 3.97 3.97 0 0 0-2.13 3.98 4.13 4.13 0 0 0 2.66 3.53v.04a10.95 10.95 0 0 1-1.66 3.07c-.64.84-1.42 1.96-2.8 1.96-1.2 0-2-.74-3.23-.76-1.3-.02-2.02.62-3.2.78ZM7.75 5.25A4.73 4.73 0 0 1 9 1.69 5.4 5.4 0 0 1 12.17 0h.16a4.87 4.87 0 0 1-1.23 3.67 3.86 3.86 0 0 1-3.03 1.6l-.32-.02Z"></path> 242 </svg> 243 Accedi con Apple 244 </a> 245 </div> 246 <p class="font-14 text-center my-4">oppure procedi come ospite</p> 247 <p class="fw-bold">Contatti</p> 248 <form id="form-register" novalidate> 249 <div class="mb-3"> 250 <div class="d-flex justify-content-between align-items-center"> 251 <label for="email" class="form-label">Email</label> 252 <div class="font-12"> 253 Hai già un account? 254 <button class="font-12 text-decoration-underline color-blue p-0 border-0 bg-transparent" 255 type="button" data-bs-toggle="modal" data-bs-target="#modalLogin"> 256 Accedi 257 </button> 258 </div> 259 </div> 260 <input type="email" class="form-control" id="email" name="email"> 261 <span id="Email.Error"></span> 262 <p class="font-12 mt-2 mb-0"> 263 Lâ email è necessaria per inviarti comunicazioni 264 sullâordine 265 </p> 266 <div class="font-14 fw-bold mt-3"> 267 Vuoi creare un account? 268 <button class="p-0 border-0 bg-transparent font-14 color-blue text-decoration-underline" 269 type="button" data-bs-toggle="collapse" data-bs-target="#collapseScegliPassword" 270 aria-expanded="false" aria-controls="collapseScegliPassword"> 271 Ti basta scegliere 272 una password 273 </button> 274 </div> 275 <div id="collapseScegliPassword" 276 class="accordion-collapse collapse"> 277 <div class="bg-gray-10 rounded-3 p-3 p-md-4 mt-3"> 278 <div class="d-flex justify-content-between align-items-center mb-3"> 279 <p class="font-14 fw-bold mb-0">Scegli la password</p> 280 <button class="p-0 border-0 bg-transparent font-14 color-blue text-decoration-underline" 281 id="btnCloseScegliPassword" type="button"> 282 Non voglio più creare un account 283 </button> 284 285 </div> 286 <div class="row g-3"> 287 <div class="col-6 mb-0"> 288 <label for="password" class="form-label">Password</label> 289 <input type="password" class="form-control" id="password" 290 name="password" disabled> 291 </div> 292 <div class="col-6 mb-0"> 293 <label for="passwordConfirm" class="form-label"> 294 Conferma 295 password 296 </label> 297 <input type="password" class="form-control" id="passwordConfirm" 298 name="passwordConfirm" disabled> 299 </div> 300 </div> 301 <p class="font-14 mt-3 mb-0"> 302 Completato l'acquisto, il sistema genererà 303 automaticamente un account con le credenziali da te fornite. 304 </p> 305 </div> 306 </div> 307 </div> 308 </form> 309 <!-- End - Guest --> 310 311 </div> 312 313 314 315 316<div class="checkout-shipping mb-5" id="checkoutShipping" hx-swap-oob="true"> 317 <p class="fw-bold mb-1">Spedizione</p> 318 <p class="font-14">Seleziona un metodo di spedizione</p> 319 320 321<ul id="shipping-tab" class="nav nav-pills mb-3 shipping-tab" data-gtm="null"> 322 <li class="nav-item"> 323 <button hx-post="/umbraco/surface/umbecommerce/UpdateCheckout" hx-trigger="click" hx-vals='{"shippingMethodType": "InStorePickup", "paymentCode": ""}' hx-indicator="#loader" hx-include="#transactionId, #shipping-address-form, #form-fatturazione, #form-user-type, #form-fattura, #form-check-privacy, #form-check-request-invoice, #form-store-pickup-code, #form-note, #form-discountCode, #check-fatt-sped, #brt-form, #paymentForm, #form-total-price" hx-swap="outerHTML focus-scroll:false" type="button" class="nav-link opacity-25" id="shipping-InStorePickup" disabled="disabled" data-gtm-shipping> 324 325 Ritiro in negozio 326 327 </button> 328 </li> 329 <li class="nav-item"> 330 <button hx-post="/umbraco/surface/umbecommerce/UpdateCheckout" hx-trigger="click" hx-vals='{"shippingMethodType": "HomeDelivery", "paymentCode": ""}' hx-indicator="#loader" hx-include="#transactionId, #shipping-address-form, #form-fatturazione, #form-user-type, #form-fattura, #form-check-privacy, #form-check-request-invoice, #form-store-pickup-code, #form-note, #form-discountCode, #check-fatt-sped, #brt-form, #paymentForm, #form-total-price" hx-swap="outerHTML focus-scroll:false" class="nav-link opacity-25" id="shipping-HomeDelivery" type="button" disabled="disabled" data-gtm-shipping> 331 332 Consegna a domicilio 333 334 </button> 335 </li> 336 <li class="nav-item"> 337 <button hx-post="/umbraco/surface/umbecommerce/UpdateCheckout" hx-trigger="click" hx-vals='{"shippingMethodType": "BrtPickupPoint", "paymentCode": ""}' hx-indicator="#loader" hx-include="#transactionId, #shipping-address-form, #form-fatturazione, #form-user-type, #form-fattura, #form-check-privacy, #form-check-request-invoice, #form-store-pickup-code, #form-note, #form-discountCode, #check-fatt-sped, #brt-form, #paymentForm, #form-total-price" hx-swap="outerHTML" class="nav-link opacity-25" id="shipping-BrtPickupPoint" type="button" disabled="disabled" data-gtm-shipping> 338 339 Punto di ritiro BRT 340 341 342 </button> 343 </li> 344</ul> 345
346 <div id="shipping-content" class="bg-gray-10 rounded-3 p-3 p-md-4 mt-3 d-none"> 347 <form id="form-store-pickup-code" class="mb-4" hx-post="/umbraco/surface/umbecommerce/UpdateCheckout" hx-trigger="change" hx-indicator="#loader" hx-swap="outerHTML" hx-on:htmx:before-request="this.querySelector('select').blur()" hx-vals='{"shippingMethodType":"Unknown"}' hx-include="#transactionId, #shipping-address-form, #form-fatturazione, #form-user-type, #form-fattura, #form-check-privacy, #form-check-request-invoice, #form-store-pickup-code, #form-note, #form-discountCode, #check-fatt-sped, #brt-form, #paymentForm, #form-total-price" data-shipping="shop" novalidate> 348 <label class="form-label fw-bold" for="ShippingMethodResponse_StorePickup_StorePickupCode">Punto di 349 ritiro</label> 350 <select name="StorePickupCode" class="form-select" data-val="true" data-val-required="The StorePickupCode field is required." id="ShippingMethodResponse_StorePickup_StorePickupCode"> 351 <option value="" selected="selected">Seleziona...</option> 352 </select> 353 <span id="StorePickupCode.Error"></span> 354 </form> 355 356 <div data-shipping="delivery"> 357 <p class="fw-bold">Indirizzo di spedizione</p> 358 <div id="shipping-address-form-cont" 359 class=""> 360 <form id="shipping-address-form" class="mb-4" novalidate> 361 <div class="row g-3"> 362 <div class="col-md-6"> 363 <label class="form-label" for="ShippingAddress_Description">Nome e cognome</label> 364 <input type="text" class="form-control" aria-label="name" id="ShippingAddress_Description" name="ShippingAddress.Description" value=""> 365 <span id="ShippingAddress.Description.Error"></span> 366 </div> 367 <div class="col-md-6"> 368 <label class="form-label" for="ShippingAddress_Phone">Telefono</label> 369 <div class="input-group"> 370 <input type="tel" class="form-control border-end-0" id="ShippingAddress_Phone" name="ShippingAddress.Phone" value=""> 371 372 <div class="input-group-text bg-white border-start-0" data-bs-toggle="tooltip" 373 data-bs-placement="top" 374 data-bs-title="Il tuo numero verrà utilizzato solo in caso di problemi riguardanti l'ordine."> 375 <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" 376 class="bi bi-question-circle" viewBox="0 0 16 16"> 377 <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"/> 378 <path 379 d="M5.255 5.786a.237.237 0 0 0 .241.247h.825c.138 0 .248-.113.266-.25.09-.656.54-1.134 1.342-1.134.686 0 1.314.343 1.314 1.168 0 .635-.374.927-.965 1.371-.673.489-1.206 1.06-1.168 1.987l.003.217a.25.25 0 0 0 .25.246h.811a.25.25 0 0 0 .25-.25v-.105c0-.718.273-.927 1.01-1.486.609-.463 1.244-.977 1.244-2.056 0-1.511-1.276-2.241-2.673-2.241-1.267 0-2.655.59-2.75 2.286m1.557 5.763c0 .533.425.927 1.01.927.609 0 1.028-.394 1.028-.927 0-.552-.42-.94-1.029-.94-.584 0-1.009.388-1.009.94"/> 380 </svg> 381 </div> 382 </div> 383 <span id="ShippingAddress.Phone.Error"></span> 384 </div> 385 <div class="col-12"> 386 <label class="form-label" for="ShippingAddress_Email">Email di contatto</label> 387 <input type="email" class="form-control" id="ShippingAddress_Email" name="ShippingAddress.Email" value=""> 388 <span id="ShippingAddress.Email.Error"></span> 389 <p class="font-12 mt-2 mb-0">Lâ email è necessaria per inviarti comunicazioni 390 sullâordine</p> 391 </div> 392 <div class="col-12 position-relative"> 393 <label class="form-label" for="ShippingAddress_Address">Indirizzo</label> 394 <input type="text" class="form-control" id="shipping-address-autocomplete-input" autocomplete="cfadda-no-autofill" name="ShippingAddress.Address" value=""> 395 <ul id="shipping-address-suggestions" class="list-group position-absolute w-100 z-3 d-none shadow-sm" style="top:100%; left:0;"></ul>
396 <span id="ShippingAddress.Address.Error"></span> 397 </div> 398 <div class="col-md-6"> 399 <label class="form-label" for="ShippingAddress_PostalCode">Cap</label> 400 <input type="text" class="form-control" hx-post="/umbraco/surface/umbecommerce/UpdateCheckout" hx-trigger="input changed delay:300ms" hx-indicator="#loader" hx-swap="none" hx-vals='{"shippingMethodType":"Unknown"}' hx-include="#transactionId, #shipping-address-form, #form-fatturazione, #form-user-type, #form-fattura, #form-check-privacy, #form-check-request-invoice, #form-store-pickup-code, #form-note, #form-discountCode, #check-fatt-sped, #brt-form, #paymentForm, #form-total-price" hx-on:htmx:before-request="if(this.value.length<5)event.preventDefault()" id="ShippingAddress_PostalCode" name="ShippingAddress.PostalCode" value=""> 401 <span id="ShippingAddress.PostalCode.Error"></span> 402 </div> 403 <div class="col-md-6"> 404 <label class="form-label" for="ShippingAddress_City">Città </label> 405 <input type="text" class="form-control" id="ShippingAddress_City" name="ShippingAddress.City" value=""> 406 <span id="ShippingAddress.City.Error"></span> 407 </div> 408 <div class="col-md-6"> 409 <label class="form-label" for="ShippingAddress_Province">Provincia</label> 410 <select class="form-select" id="ShippingAddress_Province" name="ShippingAddress.Province"> 411 <option value="">Seleziona...</option> 412 <option value="AG">Agrigento (AG)</option> 413 <option value="AL">Alessandria (AL)</option> 414 <option value="AN">Ancona (AN)</option> 415 <option value="AO">Valle d'Aosta (AO)</option> 416 <option value="AP">Ascoli Piceno (AP)</option> 417 <option value="AQ">L'Aquila (AQ)</option> 418 <option value="AR">Arezzo (AR)</option> 419 <option value="AT">Asti (AT)</option> 420 <option value="AV">Avellino (AV)</option> 421 <option value="BA">Bari (BA)</option> 422 <option value="BG">Bergamo (BG)</option> 423 <option value="BI">Biella (BI)</option> 424 <option value="BL">Belluno (BL)</option> 425 <option value="BN">Benevento (BN)</option> 426 <option value="BO">Bologna (BO)</option> 427 <option value="BR">Brindisi (BR)</option> 428 <option value="BS">Brescia (BS)</option> 429 <option value="BT">Barletta-Andria-Trani (BT)</option> 430 <option value="BZ">Bolzano/Bozen (BZ)</option> 431 <option value="CA">Cagliari (CA)</option> 432 <option value="CB">Campobasso (CB)</option> 433 <option value="CE">Caserta (CE)</option> 434 <option value="CH">Chieti (CH)</option> 435 <option value="CL">Caltanissetta (CL)</option> 436 <option value="CN">Cuneo (CN)</option> 437 <option value="CO">Como (CO)</option> 438 <option value="CR">Cremona (CR)</option> 439 <option value="CS">Cosenza (CS)</option> 440 <option value="CT">Catania (CT)</option> 441 <option value="CZ">Catanzaro (CZ)</option> 442 <option value="EN">Enna (EN)</option> 443 <option value="FC">Forlì-Cesena (FC)</option> 444 <option value="FE">Ferrara (FE)</option> 445 <option value="FG">Foggia (FG)</option> 446 <option value="FI">Firenze (FI)</option> 447 <option value="FM">Fermo (FM)</option> 448 <option value="FR">Frosinone (FR)</option> 449 <option value="GE">Genova (GE)</option> 450 <option value="GO">Gorizia (GO)</option> 451 <option value="GR">Grosseto (GR)</option> 452 <option value="IM">Imperia (IM)</option> 453 <option value="IS">Isernia (IS)</option> 454 <option value="KR">Crotone (KR)</option> 455 <option value="LC">Lecco (LC)</option> 456 <option value="LE">Lecce (LE)</option> 457 <option value="LI">Livorno (LI)</option> 458 <option value="LO">Lodi (LO)</option> 459 <option value="LT">Latina (LT)</option> 460 <option value="LU">Lucca (LU)</option> 461 <option value="MB">Monza e della Brianza (MB)</option> 462 <option value="MC">Macerata (MC)</option> 463 <option value="ME">Messina (ME)</option> 464 <option value="MI">Milano (MI)</option> 465 <option value="MN">Mantova (MN)</option> 466 <option value="MO">Modena (MO)</option> 467 <option value="MS">Massa-Carrara (MS)</option> 468 <option value="MT">Matera (MT)</option> 469 <option value="NA">Napoli (NA)</option> 470 <option value="NO">Novara (NO)</option> 471 <option value="NU">Nuoro (NU)</option> 472 <option value="OR">Oristano (OR)</option> 473 <option value="PA">Palermo (PA)</option> 474 <option value="PC">Piacenza (PC)</option> 475 <option value="PD">Padova (PD)</option> 476 <option value="PE">Pescara (PE)</option> 477 <option value="PG">Perugia (PG)</option> 478 <option value="PI">Pisa (PI)</option> 479 <option value="PN">Pordenone (PN)</option> 480 <option value="PO">Prato (PO)</option> 481 <option value="PR">Parma (PR)</option> 482 <option value="PT">Pistoia (PT)</option> 483 <option value="PU">Pesaro e Urbino (PU)</option> 484 <option value="PV">Pavia (PV)</option> 485 <option value="PZ">Potenza (PZ)</option> 486 <option value="RA">Ravenna (RA)</option> 487 <option value="RC">Reggio Calabria (RC)</option> 488 <option value="RE">Reggio nell'Emilia (RE)</option> 489 <option value="RG">Ragusa (RG)</option> 490 <option value="RI">Rieti (RI)</option> 491 <option value="RM">Roma (RM)</option> 492 <option value="RN">Rimini (RN)</option> 493 <option value="RO">Rovigo (RO)</option> 494 <option value="SA">Salerno (SA)</option> 495 <option value="SI">Siena (SI)</option> 496 <option value="SO">Sondrio (SO)</option> 497 <option value="SP">La Spezia (SP)</option> 498 <option value="SR">Siracusa (SR)</option> 499 <option value="SS">Sassari (SS)</option> 500 <option value="SU">Sud Sardegna (SU)</option> 501 <option value="SV">Savona (SV)</option> 502 <option value="TA">Taranto (TA)</option> 503 <option value="TE">Teramo (TE)</option> 504 <option value="TN">Trento (TN)</option> 505 <option value="TO">Torino (TO)</option> 506 <option value="TP">Trapani (TP)</option> 507 <option value="TR">Terni (TR)</option> 508 <option value="TS">
508Trieste (TS)</option> 509 <option value="TV">Treviso (TV)</option> 510 <option value="UD">Udine (UD)</option> 511 <option value="VA">Varese (VA)</option> 512 <option value="VB">Verbano-Cusio-Ossola (VB)</option> 513 <option value="VC">Vercelli (VC)</option> 514 <option value="VE">Venezia (VE)</option> 515 <option value="VI">Vicenza (VI)</option> 516 <option value="VR">Verona (VR)</option> 517 <option value="VT">Viterbo (VT)</option> 518 <option value="VV">Vibo Valentia (VV)</option> 519 </select> 520 <span id="ShippingAddress.Province.Error"></span> 521 </div> 522 <div class="col-md-6"> 523 <label for="inputStato" class="form-label">Stato</label> 524 <input type="text" class="form-control" id="inputStato" readonly data-val="true" data-val-required="The Country field is required." name="ShippingAddress.Country" value="ITALIA"> 525 </div> 526 </div> 527 </form> 528 </div> 529 </div> 530 531 <div data-shipping="brt"> 532 <!-- Hidden master che conterranno i valori del punto selezionato --> 533 534<form id="brt-form" novalidate> 535 <input type="hidden" id="master_BRT_PUDO_ID" data-val="true" data-val-required="The BrtPickupPointId field is required." name="BrtPickupPointId" value=""> 536 <input type="hidden" id="master_BRT_PUDO_NAME" data-val="true" data-val-required="The BrtPickupPointName field is required." name="BrtPickupPointName" value=""> 537 <input type="hidden" id="master_BRT_PUDO_ADDRESS" data-val="true" data-val-required="The BrtPickupPointAddress field is required." name="BrtPickupPointAddress" value=""> 538</form> 539<p class="font-14">
539Puoi scegliere di far consegnare il pacco in un punto di ritiro invece che al tuo 540 indirizzo di casa o di lavoro e ritirarlo quando preferisci</p> 541<p class="fw-bold mb-2">Punto di ritiro</p> 542<button type="button" class="btn btn-secondary text-uppercase fw-bold mb-4" data-bs-toggle="modal" 543 data-bs-target="#modalBRT" id="btn-select-brt">Seleziona pickup point 544</button> 545 546<!-- Start - Da Far vedere una volta selezionato pickup point --> 547<div id="box-riep-brt" 548 class="d-flex align-items-start justify-content-between bg-primary rounded-2 p-3 mb-4 d-none"> 549 <div> 550 <p class="fw-bold text-white mb-1" id="brt-selected-name"></p> 551 <p class="font-14 text-white mb-0" id="brt-selected-address"></p> 552 </div> 553 <button type="button" class="btn btn-secondary lh-1" data-bs-toggle="modal" data-bs-target="#modalBRT"> 554 <img class="img-fluid" src="/inc/img/ico-modifica.svg" alt="Modifica" width="16" height="16" loading="lazy"></button> 555</div> 556 557 558 559 <!-- End - Da Far vedere una volta selezionato pickup point --> 560 </div> 561 562 <!-- Start - Dati fatturazione --> 563 <p class="fw-bold">Dati di fatturazione</p> 564 565 <div class="mb-3"> 566 <form id="form-user-type" novalidate> 567 <div class="col-12" id="user-type"> 568 <div class="form-check form-check-inline me-5"> 569 <input class="form-check-input" type="radio" id="tipoPrivato" value="1" checked="checked" data-val="true" data-val-required="The UserType field is required." name="UserType"> 570 <label class="form-check-label" for="tipoPrivato">Privato</label> 571 </div> 572 <div class="form-check form-check-inline"> 573 <input class="form-check-input" type="radio" id="tipoAzienda" value="2" name="UserType"> 574 <label class="form-check-label" for="tipoAzienda">Azienda</label> 575 </div> 576 </div> 577 </form> 578 </div> 579 580 581 582 <div class="mb-3" data-shipping="delivery"> 583 <form class="form-check" id="check-fatt-sped" novalidate> 584 <input name="UseShippingAddressForBilling" value="true" 585 checked class="form-check-input" type="checkbox" 586 id="inlineFormCheck"> 587 <label class="form-check-label" for="inlineFormCheck"> 588 Usa lo stesso indirizzo della spedizione 589 </label> 590 </form> 591 </div> 592 593 <div id="form-fatturazione-cont" 594 class=""> 595 <form action="" id="form-fatturazione" novalidate> 596 <div class="row g-3"> 597 598 <!-- Start - Da far vedere se checkbox non selezionato --> 599 <div class="col-md-6"> 600 <label class="form-label" data-user-type="azienda" for="BillingAddress_Description">Ragione sociale</label> 601 <label class="form-label" data-user-type="privato" for="BillingAddress_Description">Nome e cognome</label> 602 603 <input type="text" class="form-control" aria-label="name" id="BillingAddress_Description" name="BillingAddress.Description" value=""> 604 <span id="BillingAddress.Description.Error"></span> 605 </div> 606 <div class="col-md-6"> 607 <label class="form-label" for="BillingAddress_Phone">Telefono</label> 608 <div class="input-group"> 609 <input type="tel" class="form-control border-end-0" id="BillingAddress_Phone" name="BillingAddress.Phone" value=""> 610 <div class="input-group-text bg-white border-start-0" data-bs-toggle="tooltip" 611 data-bs-placement="top" 612 data-bs-title="Il tuo numero verrà utilizzato solo in caso di problemi riguardanti l'ordine."> 613 <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" 614 class="bi bi-question-circle" viewBox="0 0 16 16"> 615 <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"/> 616 <path 617 d="M5.255 5.786a.237.237 0 0 0 .241.247h.825c.138 0 .248-.113.266-.25.09-.656.54-1.134 1.342-1.134.686 0 1.314.343 1.314 1.168 0 .635-.374.927-.965 1.371-.673.489-1.206 1.06-1.168 1.987l.003.217a.25.25 0 0 0 .25.246h.811a.25.25 0 0 0 .25-.25v-.105c0-.718.273-.927 1.01-1.486.609-.463 1.244-.977 1.244-2.056 0-1.511-1.276-2.241-2.673-2.241-1.267 0-2.655.59-2.75 2.286m1.557 5.763c0 .533.425.927 1.01.927.
617609 0 1.028-.394 1.028-.927 0-.552-.42-.94-1.029-.94-.584 0-1.009.388-1.009.94"/> 618 </svg> 619 </div> 620 </div> 621 <span id="BillingAddress.Phone.Error"></span> 622 </div> 623 <div class="col-12"> 624 <label class="form-label" for="BillingAddress_Email">Email di contatto</label> 625 <input type="email" class="form-control" id="BillingAddress_Email" name="BillingAddress.Email" value=""> 626 <p class="font-12 mt-2 mb-0">Lâ email è necessaria per inviarti comunicazioni sullâordine</p> 627 <span id="BillingAddress.Email.Error"></span> 628 </div> 629 <!-- Start - Se il tipo utente selezionato è Azienda far vedere questi campi --> 630 <!-- End - Se il tipo utente selezionato è Azienda far vedere questi campi --> 631 <div class="col-12 position-relative"> 632 <label class="form-label" for="BillingAddress_Address">Indirizzo</label> 633 <input type="text" class="form-control" id="billing-address-autocomplete-input" autocomplete="cfadda-no-autofill" name="BillingAddress.Address" value=""> 634 <ul id="billing-address-suggestions" class="list-group position-absolute w-100 z-3 d-none shadow-sm" style="top:100%; left:0;"></ul> 635 <span id="BillingAddress.Address.Error"></span> 636 </div> 637 <div class="col-md-6"> 638 <label class="form-label" for="BillingAddress_PostalCode">Cap</label> 639 <input type="text" class="form-control" id="BillingAddress_PostalCode" name="BillingAddress.PostalCode" value=""> 640 <span id="BillingAddress.PostalCode.Error"></span> 641 </div> 642 <div class="col-md-6"> 643 <label class="form-label" for="BillingAddress_City">Città </label> 644 <input type="text" class="form-control" id="BillingAddress_City" name="BillingAddress.City" value=""> 645 <span id="BillingAddress.City.Error"></span> 646 </div> 647 <div class="col-md-6"> 648 <label class="form-label" for="BillingAddress_Province">Provincia</label> 649 <select class="form-select" id="BillingAddress_Province" name="BillingAddress.Province"> 650 <option value="">Seleziona...</option> 651 <option value="AG">Agrigento (AG)</option> 652 <option value="AL">Alessandria (AL)</option> 653 <option value="AN">Ancona (AN)</option> 654 <option value="AO">Valle d'Aosta (AO)</option> 655 <option value="AP">Ascoli Piceno (AP)</option> 656 <option value="AQ">L'Aquila (AQ)</option> 657 <option value="AR">Arezzo (AR)</option> 658 <option value="AT">Asti (AT)</option> 659 <option value="AV">Avellino (AV)</option> 660 <option value="BA">Bari (BA)</option> 661 <option value="BG">Bergamo (BG)</option> 662 <option value="BI">Biella (BI)</option> 663 <option value="BL">Belluno (BL)</option> 664 <option value="BN">Benevento (BN)</option> 665 <option value="BO">Bologna (BO)</option> 666 <option value="BR">Brindisi (BR)</option> 667 <option value="BS">Brescia (BS)</option> 668 <option value="BT">Barletta-Andria-Trani (BT)</option> 669 <option value="BZ">Bolzano/Bozen (BZ)</option> 670 <option value="CA">Cagliari (CA)</option> 671 <option value="CB">Campobasso (CB)</option> 672 <option value="CE">Caserta (CE)</option> 673 <option value="CH">Chieti (CH)</option> 674 <option value="CL">Caltanissetta (CL)</option> 675 <option value="CN">Cuneo (CN)</option> 676 <option value="CO">Como (CO)</option> 677 <option value="CR">Cremona (CR)</option> 678 <option value="CS">Cosenza (CS)</option> 679 <option value="CT">Catania (CT)</option> 680 <option value="CZ">Catanzaro (CZ)</option> 681 <option value="EN">Enna (EN)</option> 682 <option value="FC">Forlì-Cesena (FC)</option> 683 <option value="FE">Ferrara (FE)</option> 684 <option value="FG">Foggia (FG)</option> 685 <option value="FI">Firenze (FI)</option> 686 <option value="FM">Fermo (FM)</option> 687 <option value="FR">Frosinone (FR)</option> 688 <option value="GE">Genova (GE)</option> 689 <option value="GO">Gorizia (GO)</option> 690 <option value="GR">Grosseto (GR)</option> 691 <option value="IM">Imperia (IM)</option> 692 <option value="IS">Isernia (IS)</option> 693 <option value="KR">Crotone (KR)</option> 694 <option value="LC">Lecco (LC)</option> 695 <option value="LE">Lecce (LE)</option> 696 <option value="LI">Livorno (LI)</option> 697 <option value="LO">Lodi (LO)</option> 698 <option value="LT">Latina (LT)</option> 699 <option value="LU">Lucca (LU)</option> 700 <option value="MB">Monza e della Brianza (MB)</option> 701 <option value="MC">Macerata (MC)</option> 702 <option value="ME">Messina (ME)</option> 703 <option value="MI">Milano (MI)</option> 704 <option value="MN">Mantova (MN)</option> 705 <option value="MO">Modena (MO)</option> 706 <option value="MS">Massa-Carrara (MS)</option> 707 <option value="MT">Matera (MT)</option> 708 <option value="NA">Napoli (NA)</option> 709 <option value="NO">Novara (NO)</option> 710 <option value="NU">Nuoro (NU)</option> 711 <option value="OR">Oristano (OR)</option> 712 <option value="PA">Palermo (PA)</option> 713 <option value="PC">Piacenza (PC)</option> 714 <option value="PD">Padova (PD)</option> 715 <option value="PE">Pescara (PE)</option> 716 <option value="PG">Perugia (PG)</option> 717 <option value="PI">Pisa (PI)</option> 718 <option value="PN">Pordenone (PN)</option> 719 <option value="PO">Prato (PO)</option> 720 <option value="PR">Parma (PR)</option> 721 <option value="PT">Pistoia (PT)</option> 722 <option value="PU">Pesaro e Urbino (PU)</option> 723 <option value="PV">Pavia (PV)</option> 724 <option value="PZ">Potenza (PZ)</option> 725 <option value="RA">Ravenna (RA)</option> 726 <option value="RC">Reggio Calabria (RC)</option> 727 <option value="RE">Reggio nell'Emilia (RE)</option> 728 <option value="RG">Ragusa (RG)</option> 729 <option value="RI">Rieti (RI)</option> 730 <option value="RM">Roma (RM)</option> 731 <option value="RN">Rimini (RN)</option> 732 <option value="RO">Rovigo (RO)</option> 733 <option value="SA">Salerno (SA)</option> 734 <option value="SI">Siena (SI)</option> 735 <option value="SO">Sondrio (SO)</option> 736 <option value="SP">La Spezia (SP)</option> 737 <option value="SR">Siracusa (SR)</option> 738 <option value="SS">Sassari (SS)</option> 739 <option value="SU">Sud Sardegna (SU)</option> 740 <option value="SV">Savona (SV)</option> 741 <option value="TA">Taranto (TA)</option> 742 <option value="TE">Teramo (TE)</option> 743 <option value="TN">Trento (TN)</option> 744 <option value="TO">Torino (TO)</option> 745 <option value="TP">Trapani (TP)</option> 746 <option value="TR">Terni (TR)</option> 747 <option value="TS">
747Trieste (TS)</option> 748 <option value="TV">Treviso (TV)</option> 749 <option value="UD">Udine (UD)</option> 750 <option value="VA">Varese (VA)</option> 751 <option value="VB">Verbano-Cusio-Ossola (VB)</option> 752 <option value="VC">Vercelli (VC)</option> 753 <option value="VE">Venezia (VE)</option> 754 <option value="VI">Vicenza (VI)</option> 755 <option value="VR">Verona (VR)</option> 756 <option value="VT">Viterbo (VT)</option> 757 <option value="VV">Vibo Valentia (VV)</option> 758 </select> 759 <span id="BillingAddress.Province.Error"></span> 760 </div> 761 <div class="col-md-6"> 762 <label class="form-label" for="BillingAddress_Country">Stato</label> 763 <input type="text" class="form-control" readonly data-val="true" data-val-required="The Country field is required." id="BillingAddress_Country" name="BillingAddress.Country" value="ITALIA"> 764 </div> 765 <!-- End - Da far vedere se checkbox non selezionato --> 766 </div> 767 </form> 768 </div> 769 </div> 770</div> 771 772 773 774 775 776 777 778 779 780<div class="checkout-payment mb-4" id="checkoutPayment" hx-swap-oob="true" data-gtm="null"> 781 <p class="fw-bold mb-3">Pagamento</p> 782 783 <form id="paymentForm" hx-post="/umbraco/surface/umbecommerce/UpdateCheckout" hx-trigger="change[event.target.name==='paymentCode']" hx-indicator="#loader" hx-swap="outerHTML focus-scroll:false" hx-vals='{"shippingMethodType":"Unknown"}' hx-include="#transactionId, #shipping-address-form, #form-fatturazione, #form-user-type, #form-fattura, #form-check-privacy, #form-check-request-invoice, #form-store-pickup-code, #form-note, #form-discountCode, #check-fatt-sped, #brt-form, #paymentForm, #form-total-price" data-gtm-payment novalidate> 784 </form> 785</div> 786
787<script> 788 // Guard: il listener viene registrato una sola volta anche se HTMX re-inietta la partial 789 if (!window._paymentBoxHandlerRegistered) { 790 window._paymentBoxHandlerRegistered = true; 791 792 document.addEventListener('click', function (e) { 793 const box = e.target.closest('.checkout-payment-box-radio'); 794 if (!box) return; 795 796 // Radio cliccato direttamente: genera già il suo evento change nativo, non serve fare nulla 797 if (e.target.type === 'radio') return; 798 799 // Checkbox (es. "salva carta"): il form non deve triggerare 800 // Lo blocchiamo fermando la propagazione solo per il change che genererebbe 801 if (e.target.type === 'checkbox') return; 802 803 // Bottoni, link e card-item hanno la propria logica 804 if ( 805 e.target.closest('button') || 806 e.target.closest('a') || 807 e.target.closest('.checkout-payment-card-item') 808 ) return; 809 810 // Click sull'area del box o sulla label: seleziona il radio e dispatcha change 811 // â hx-trigger="change" intercetta l'evento e parte la chiamata HTMX 812 const radio = box.querySelector('input[type="radio"][name="paymentCode"]'); 813 if (radio && !radio.checked) { 814 radio.checked = true; 815 radio.dispatchEvent(new Event('change', {bubbles: true})); 816 } 817 }); 818 } 819 820</script>
820 821 822 823 <div class="checkout-privacy mb-3"> 824 <div class="form-check"> 825 <form id="form-check-privacy" novalidate> 826 <input name="DeclaresAcceptanceOfTerms" value="true" 827 class="form-check-input" 828 id="DeclaresAcceptanceOfTerms" 829 type="checkbox"> 830 <label for="DeclaresAcceptanceOfTerms" class="form-check-label"> 831 Dichiaro di aver letto e accettato la 832 <a href="/privacy" target="_blank" title="privacy policy">privacy policy</a> 833 e le 834 <a href="/condizioni-generali-di-vendita" target="_blank" title="privacy policy"> 835 Condizioni 836 Generali di Vendita 837 </a> 838 </label> 839 </form> 840 <span id="DeclaresAcceptanceOfTerms.Error"></span> 841 </div> 842 </div> 843 844 845 846<div class="checkout-invoice mb-5"> 847 <div class="form-check"> 848 <form id="form-check-request-invoice" novalidate> 849 <input name="RequestsInvoice" value="true" 850 class="form-check-input" 851 type="checkbox" id="RequestsInvoice"> 852 <label class="form-check-label" for="RequestsInvoice"> 853 Desidero ricevere fattura 854 </label> 855 </form> 856 </div> 857 <form class="mt-3 d-none" action="" id="form-fattura" novalidate> 858 <!-- Se utente privato --> 859 <div class="row d-none" data-user-type="privato"> 860 <div class="col-12"> 861 <label class="form-label" for="TaxCode">Codice Fiscale</label> 862 <input class="form-control" aria-label="name" type="text" data-val="true" data-val-required="The TaxCode field is required." id="TaxCode" name="TaxCode" value=""> 863 <span id="TaxCode.Error"></span> 864 </div> 865 </div> 866 867 <!-- Se utente azienda --> 868 <div class="row d-none" data-user-type="azienda"> 869 <p class="font-14 fw-bold mb-2">Inserisci la Partita IVA, il Codice SDI o la tua PEC</p> 870 <div class="col-12"> 871 <label class="form-label" for="VatNumber">Partita IVA</label> 872 <input type="text" class="form-control" data-val="true" data-val-required="The VatNumber field is required." id="VatNumber" name="VatNumber" value=""> 873 <span id="VatNumber.Error"></span> 874 </div> 875 <div class="col-md-6"> 876 <label class="form-label" for="SdiCode">Codice SDI</label> 877 <input type="text" class="form-control" aria-label="name" data-val="true" data-val-required="The SdiCode field is required." id="SdiCode" name="SdiCode" value=""> 878 <span id="SdiCode.Error"></span> 879 </div> 880 <div class="col-md-6"> 881 <label class="form-label" for="PecEmail">PEC 882 </label> 883 <input type="email" class="form-control" aria-label="name" data-val="true" data-val-required="The PecEmail field is required." id="PecEmail" name="PecEmail" value=""> 884 <span id="PecEmail.Error"></span> 885 </div> 886 </div> 887 </form> 888</div> 889 890 891 892<div class="bg-gray-10 rounded-3 p-3 p-md-4 mb-3 d-lg-none" id="checkoutSummaryMobile" hx-swap-oob="true"> 893 <p class="fw-bold mb-3">Riepilogo</p> 894 <p class="font-14 d-flex gap-2 align-items-start justify-content-between mb-2"> 895 Subtotale 896 <span>€ 0,00</span> 897 </p> 898 <p class="font-14 d-flex gap-2 align-items-start justify-content-between mb-2"> 899 Spedizione 900 <span> Seleziona metodo spedizione</span> 901 </p> 902 <div class="border-bottom border-secondary mb-2"></div> 903 <p class="fw-bold text-uppercase d-flex gap-2 align-items-start justify-content-between mb-2"> 904 Totale
905 <span>€ 0,00</span> 906 </p> 907</div> 908 909 910<div class="checkout-submit" id="checkoutPaymentButton" hx-swap-oob="true"> 911 <button hx-post="/umbraco/surface/umbecommerce/SendOrder" hx-trigger="click" hx-swap="none" hx-vals='{"shippingMethodType": "Unknown", "paymentCode": ""}' hx-indicator="#loader" hx-include="#transactionId, #shipping-address-form, #form-fatturazione, #form-user-type, #form-fattura, #form-check-privacy, #form-check-request-invoice, #form-store-pickup-code, #form-note, #form-discountCode, #check-fatt-sped, #brt-form, #paymentForm, #form-total-price, #form-register" type="button" disabled="disabled" class="btn btn-secondary btn-confirm fw-bold text-uppercase w-100 py-2">Conferma e 912 paga ordine 913 </button> 914</div> 915 916<!-- Apple and Google Pay --> 917 918 919<!-- Conferma e paga fixed -->
920<script> 921 let observer = null; 922 923 function initStickySubmit() { 924 const container = document.querySelector('.checkout-submit'); 925 const btn = document.querySelector('.btn-confirm'); 926 if (!container || !btn) return; 927 928 observer?.disconnect(); 929 930 observer = new IntersectionObserver( 931 ([entry]) => { 932 btn.classList.toggle('is-sticky', window.innerWidth <= 991 && !entry.isIntersecting); 933 }, 934 { threshold: 0 } 935 ); 936 937 observer.observe(container); 938 } 939 940 document.addEventListener('DOMContentLoaded', initStickySubmit); 941 document.addEventListener('htmx:afterSettle', initStickySubmit); 942 943</script>
943 944 945 </div> 946 947 <div class="col-lg-5 px-0 px-sm-3"> 948 <div class="sticky-lg-top" style="top: 20px;"> 949 950 <button class="btn-collapse fw-bold collapsed w-100 d-flex align-items-center justify-content-between d-lg-none py-4 px-3 p-lg-4" 951 type="button" data-bs-toggle="collapse" data-bs-target="#checkoutRiepilogo" 952 aria-expanded="false" aria-controls="checkoutRiepilogo"> 953 <span class="btn-collapse-icon d-flex gap-2">Riepilogo</span> 954 955<span id="CheckoutTotalPriceMobile" hx-swap-oob="true">€ 0,00</span> 956 </button> 957 958 <div class="collapse d-lg-block" id="checkoutRiepilogo"> 959 <div id="checkoutSummary" hx-swap-oob="true"> 960 <div class="bg-gray-10 rounded-3 p-3 p-lg-4 mb-0 mb-lg-3 rounded-0-mob"> 961 <div class="d-flex align-items-center justify-content-between mb-4"> 962 <p class="fw-bold mb-0">Carrello</p> 963 <a href="/il-tuo-carrello/" class="font-12 color-blue">Modifica carrello</a> 964 </div> 965 966 </div> 967 968 <div class="details-container bg-gray-10 rounded-3 py-2 px-3 p-lg-4 mb-0 mb-lg-3 rounded-0-mob"> 969 <details id="discount-details" > 970 <summary class="fw-bold">Codice sconto</summary> 971 <form id="form-discountCode" hx-post="/umbraco/surface/umbecommerce/UpdateCheckout" hx-indicator="#loader" hx-vals='{"shippingMethodType": "Unknown", "paymentCode": "", "fromCouponForm":true}' hx-include="#transactionId, #shipping-address-form, #form-fatturazione, #form-user-type, #form-fattura, #form-check-privacy, #form-check-request-invoice, #form-store-pickup-code, #form-note, #form-discountCode, #check-fatt-sped, #brt-form, #paymentForm, #form-total-price" novalidate> 972 <div class="coupon mt-2 mt-lg-3"> 973 <input type="text" placeholder="Inserisci qui il codice sconto" class="form-control" name="DiscountCode" data-val="true" data-val-required="The DiscountCode field is required." id="Cart_Summary_DiscountCode" value=""> 974 <input type="hidden" name="DiscountApplied" data-val="true" data-val-required="The DiscountApplied field is required." id="Cart_Summary_DiscountApplied" value="False"> 975 976 <button type="submit" class="btn btn-primary">Applica</button> 977 978 </div> 979 </form> 980 </details> 981 </div> 982 983 <div class="details-container bg-gray-10 rounded-3 p-3 p-lg-4 mb-0 mb-lg-3 rounded-0-mob"> 984 <details id="note-details" > 985 <summary class="fw-bold">Note ordine</summary> 986 <div class="note mt-2 mt-lg-3"> 987 <form id="form-note" novalidate> 988 <textarea class="form-control" rows="4" cols="50" placeholder="Inserisci la tua nota..." data-val="true" data-val-required="The Note field is required." id="Note" name="Note"> 989</textarea> 990 </form> 991 </div> 992 </details> 993 </div> 994 995 <div class="bg-gray-10 rounded-3 py-3 px-3 p-lg-4 mb-0 mb-lg-3 rounded-0-mob"> 996 <p class="fw-bold mb-3">Riepilogo</p> 997 <p class="font-14 d-flex gap-2 align-items-start justify-content-between mb-2"> 998 Subtotale 999 <span>€ 0,00</span> 1000 </p> 1001 <p class="font-14 d-flex gap-2 align-items-start justify-content-between mb-2"> 1002 Spedizione 1003 <span> Seleziona metodo spedizione</span> 1004 </p> 1005 <div class="border-bottom border-secondary mb-2"></div> 1006 <p class="fw-bold text-uppercase d-flex gap-2 align-items-start justify-content-between mb-2"> 1007 Totale 1008 <span>€ 0,00</span> 1009 1010 </p> 1011 1012 <form id="form-total-price"> 1013 <input type="hidden" name="TotalPrice" data-val="true" data-val-number="The field TotalPrice must be a number." id="summary_TotalPrice" value="0"> 1014 </form> 1015 1016 1017 </div> 1018</div> 1019 </div> 1020 </div> 1021 </div> 1022 </div> 1023 </div> 1024</section> 1025 1026<input type="hidden" id="transactionId" name="TransactionId" data-val="true" data-val-required="The TransactionId field is required." value="dff234d4-7f1a-46c8-ae08-3f0a7574b101"> 1027 1028<!-- Modal Login --> 1029<div id="modalLogin" class="modal fade" tabindex="-1"> 1030 <div class="modal-dialog modal-dialog-centered"> 1031 <div class="modal-content border-0"> 1032 <div class="modal-header px-4 pt-4 border-bottom-0"> 1033 <p class="font-18 text-uppercase fw-bold mb-0">Accedi</p> 1034 <button type="button" class="btn-close font-12" data-bs-dismiss="modal" aria-label="Close"></button> 1035 </div> 1036 <div class="modal-body px-4 py-0"> 1037 1038 1039 1040<form id="loginForm" hx-post="/umbraco/surface/umbauth/ForceLoginPhp" hx-swap="outerHTML" hx-target="this" hx-indicator="#loader"> 1041 1042 <div class="mb-3"> 1043 <label class="form-label" for="Email">Email</label> 1044 <input type="email" class="form-control" required data-val="true" data-val-required="L'indirizzo email è obbligatorio." id="Email" name="Email" value="">
1045 <span class="text-danger field-validation-valid" data-valmsg-for="Email" data-valmsg-replace="true"></span> 1046 </div> 1047 <div class="mb-3"> 1048 <label class="form-label" for="Password">Password</label> 1049 <input type="password" class="form-control" required data-val="true" data-val-required="La password è obbligatoria." id="Password" name="Password"> 1050 <span class="text-danger field-validation-valid" data-valmsg-for="Password" data-valmsg-replace="true"></span> 1051 </div> 1052 1053 1054 1055</form> 1056 1057 <div class="font-14"> 1058 Hai dimenticato la password? 1059 <button class="p-0 border-0 bg-transparent font-14 color-blue text-decoration-underline" 1060 type="button" data-bs-toggle="collapse" data-bs-target="#collapseRecuperaPassword" 1061 aria-expanded="false" aria-controls="collapseRecuperaPassword"> 1062 Recupera password 1063 </button> 1064 </div> 1065 <div id="collapseRecuperaPassword" class="accordion-collapse collapse"> 1066 <div class="bg-gray-10 rounded-3 p-3 p-md-4 mt-3"> 1067 <form id="recovery-form" onsubmit="event.preventDefault(); sendPasswordRecoveryRequest();" novalidate> 1068 <div class="mb-3"> 1069 <label for="recovery-email" class="form-label"> 1070 Inserisci email di 1071 recupero 1072 </label> 1073 <input type="email" class="form-control" name="recovery-email" id="recovery-email" 1074 required> 1075 </div> 1076 <div id="genericErrorPasswordRecovery" class="text-danger font-14 mb-2" 1077 style="display:none;"> 1078 Errore di connessione... 1079 </div> 1080 <button type="submit" class="btn btn-secondary fw-bold text-uppercase w-100"> 1081 Richiedi nuova 1082 password 1083 </button> 1084 </form> 1085 </div> 1086 <!-- Messaggio dopo l'invio della richiesta di recupero password --> 1087 <div id="passwordRecoveryMessage" class="bg-gray-10 rounded-3 p-3 p-md-4 mt-3" 1088 style="display:none;"> 1089 <p class="mb-0"> 1090 Se lâindirizzo inserito è associato a un account, riceverai a breve unâemail con 1091 le istruzioni per reimpostare la password. 1092 </p> 1093 </div> 1094 </div> 1095 </div> 1096 <div class="modal-footer px-4 pt-3 pb-4 border-top-0"> 1097 <button type="submit" form="loginForm" class="btn btn-secondary fw-bold text-uppercase w-100"> 1098 Login 1099 </button> 1100 </div> 1101 </div> 1102 </div> 1103</div> 1104 1105<!-- Modal BRT --> 1106<div class="modal fade modal-BRT" id="modalBRT" tabindex="-1"> 1107 <div class="modal-dialog modal-xl modal-dialog-centered"> 1108 1109 1110<div class="modal-content border-0"> 1111 <div class="modal-header"> 1112 <h3 class="modal-title"> 1113 Scegli punto di ritiro Pick-up Point 1114 <svg xmlns="http://www.w3.org/2000/svg" width="65.28" height="32.01"
1115 viewBox="0 0 65.28 32.01"> 1116 <defs> 1117 <linearGradient id="a" x1=".14" x2=".51" y1=".85" y2=".48" 1118 gradientUnits="objectBoundingBox"> 1119 <stop offset="0" stop-color="#a80034"></stop> 1120 <stop offset="1" stop-color="#db0031"></stop> 1121 </linearGradient> 1122 </defs> 1123 <path fill="#414042" fill-rule="evenodd" 1124 d="M40.9 21.41a7.64 7.64 0 0 1-1.51-.13v-6.2a4.6 4.6 0 0 1 1.92-.36 2.97 2.97 0 0 1 3.18 3.23c0 2.21-1.38 3.46-3.6 3.46m.68-9.45a5.4 5.4 0 0 0-2.18.36V6.96h-3.13v16.59a20.13 20.13 0 0 0 4.74.54c4.01 0 6.67-2.13 6.67-6.04a5.76 5.76 0 0 0-6.1-6.1m12.4-.08c-3.07 0-5.05 1.14-5.05 4.65v7.39h3.2v-7.18a1.81 1.81 0 0 1 2.08-2 7.89 7.89 0 0 1 2.22.3v-2.95a15.5 15.5 0 0 0-2.46-.2" 1125 data-name="Tracciato 74"></path> 1126 <g data-name="Raggruppa 89"> 1127 <path fill="#414042" fill-rule="evenodd" 1128 d="M63.09 21.38a1.8 1.8 0 0 1-2.06-1.98v-4.6h4.12v-2.6h-4.12V7.87h-3.15v11.74c0 3.46 1.95 4.58 4.98 4.58a16.1 16.1 0 0 0 2.42-.2v-2.92a7.34 7.34 0 0 1-2.19.3" 1129 data-name="Tracciato 75"></path> 1130 </g> 1131 <g data-name="Raggruppa 90"> 1132 <path fill="url(#a)" fill-rule="evenodd" 1133 d="M13.73 0a1.15 1.15 0 0 0-.5.11L.69 6.95l14.05 8.17a.48.48 0 0 1 .23.4v11.92a.49.49 0 0 1-.24.39l-.76.42a.5.5 0 0 1-.22.05h-.02a.48.48 0 0 1-.24-.05l-.76-.42a.48.48 0 0 1-.23-.4V16.82a.3.3 0 0 0-.13-.21L0 9.4v14.1a1.12 1.12 0 0 0 .5.87l12.74 7.51a.94.94 0 0 0 .49.12 1.03 1.03 0 0 0 .5-.12l12.74-7.51a1.13 1.13 0 0 0 .5-.87V9.4l-8.4 4.88a.48.48 0 0 1-.45 0l-.74-.45a.48.48 0 0 1-.16-.17v-.01a.5.5 0 0 1-.09-.23l-.01-.87a.47.47 0 0 1 .22-.4l8.93-5.2L14.23.1a1.06 1.06 0 0 0-.5-.11Z" 1134 data-name="Tracciato 76" transform="translate(0 .01)"></path> 1135 </g> 1136 </svg> 1137 </h3> 1138 <button type="button" class="btn-close font-12 ms-0" data-bs-dismiss="modal" aria-label="Close"></button> 1139 </div> 1140 <div class="modal-body"> 1141 <h4 id="BRT_modal_title"></h4> 1142 <form hx-post="/umbraco/surface/umbecommerce/UpdateBrtPudo" hx-target="#brt-results" hx-swap="innerHTML" hx-indicator="#loader" novalidate> 1143 <div class="search-punto-BRT"> 1144 <div class="form-group km-field"> 1145 <div> 1146 <label for="Request_MaxDistanceSearch">Km</label> 1147 <select class="form-control" name="maxDistanceSearch" required id="Request_MaxDistanceSearch"> 1148 <option value="3000">3 Km</option> 1149 <option value="10000" selected="selected">10 Km</option> 1150 <option value="20000">20 km</option> 1151 <option value="30000">30 km</option> 1152 <option value="50000">50 km</option> 1153 </select> 1154 <span class="fieldError"></span> 1155 </div> 1156 </div> 1157 <div class="form-group cap-field"> 1158 <div> 1159 <label for="Request_ZipCode">CAP<span style="color:red">*</span></label> 1160 <input type="text" name="zipCode" class="form-control" required data-val="true" data-val-required="The ZipCode field is required." id="Request_ZipCode" value=""> 1161 <span class="fieldError"></span> 1162 </div> 1163 </div> 1164 <div class="form-group citta-field"> 1165 <div> 1166 <label for="Request_City">Citta<span style="color:red">*</span></label> 1167 <input type="text" name="city" class="form-control" required data-val="true" data-val-required="The City field is required." id="Request_City" value=""> 1168 <span class="fieldError"></span> 1169 </div> 1170 </div> 1171 <div class="form-group indirizzo-field"> 1172 <div> 1173 <label for="Request_Address">Indirizzo</label> 1174 <input type="text" name="address" class="form-control" id="Request_Address" value="">
1175 <span class="fieldError"></span> 1176 </div> 1177 <button type="submit" class="btn btn-secondary py-2">Cerca</button> 1178 </div> 1179 </div> 1180 </form> 1181 <p class="" style="color:red;" id="BRTpopupError"></p> 1182 <div id="brt-results"> 1183 1184 1185<p class="" id="BRTresultCount"> 1186 Risultato totale: 0 1187</p> 1188 1189 1190 </div> 1191 1192 </div> 1193</div> 1194 1195<!-- BRT -->
1196<script> 1197 function setBRTDetails(brt_list_id_sequence) { 1198 // 1. Gestione della lista (Rimuovi/Aggiungi classe active) 1199 const brt_list_id = 'brt_list_' + brt_list_id_sequence; 1200 1201 // Seleziona tutti gli elementi della lista e rimuovi la classe 1202 document.querySelectorAll(".result-punto-BRT-list-item").forEach(item => { 1203 item.classList.remove("result-punto-BRT-list-item-active"); 1204 }); 1205 1206 // Aggiungi la classe all'elemento selezionato 1207 const selectedList = document.getElementById(brt_list_id); 1208 if (selectedList) { 1209 selectedList.classList.add("result-punto-BRT-list-item-active"); 1210 } 1211 1212 // 2. Gestione dei dettagli (Orari e Info) 1213 const brt_list_detail_id = 'brt_list_detail_' + brt_list_id_sequence; 1214 1215 // Seleziona tutti i div dei dettagli 1216 document.querySelectorAll(".BRT-list-opening-hours-div").forEach(detail => { 1217 detail.classList.remove("result-punto-BRT-selected"); 1218 detail.classList.add("d-none"); 1219 }); 1220 1221 // Mostra il dettaglio selezionato 1222 const selectedDetail = document.getElementById(brt_list_detail_id); 1223 if (selectedDetail) { 1224 selectedDetail.classList.add("result-punto-BRT-selected"); 1225 selectedDetail.classList.remove("d-none"); 1226 } 1227 } 1228</script>
1228 1229 1230 1231 </div> 1232</div> 1233 1234<!-- Modal Delete Credit Card --> 1235<div id="modalDeleteCreditCard" class="modal fade" tabindex="-1"> 1236 <div class="modal-dialog modal-dialog-centered"> 1237 <div class="modal-content border-0"> 1238 <div class="modal-header px-4 pt-4 border-bottom-0"> 1239 <p class="font-18 text-uppercase fw-bold mb-0">Sei sicuro di voler eliminare questa carta?</p> 1240 <button type="button" class="btn-close font-12" data-bs-dismiss="modal" aria-label="Close"></button> 1241 </div> 1242 <div class="modal-body px-4 py-0 pb-4"> 1243 <p class="mb-2">La carta verrà rimossa dal tuo account.</p> 1244 <p class="fw-bold" id="modalCardInfo"></p> 1245 <input type="hidden" name="CreditCardToken" id="modalCardToken" value=""> 1246 <p class="mb-4">Potrai aggiungerne una nuova in qualsiasi momento.</p> 1247 <div class="d-flex flex-column flex-sm-row gap-3 gap-sm-4"> 1248 <button type="button" class="btn btn-outline-secondary fw-bold text-uppercase w-100" 1249 data-bs-dismiss="modal"> 1250 No, mantieni 1251 </button> 1252 <button hx-post="/umbraco/surface/umbecommerce/DeleteCreditCard" hx-target="#checkoutCreditCard" hx-trigger="click" hx-include="#modalCardToken" hx-swap="innerHTML" hx-indicator="#loader" type="button" class="btn btn-danger fw-bold text-uppercase w-100" data-bs-dismiss="modal"> 1253 Si, elimina 1254 </button> 1255 </div> 1256 </div> 1257 </div> 1258 </div> 1259</div> 1260 1261<div class="toast-container position-fixed top-0 end-0 p-3" id="toast-container"> 1262 1263 1264 <div class="toast align-items-center text-bg-danger" role="alert" aria-live="assertive" aria-atomic="true"> 1265 <div class="d-flex"> 1266 <div class="toast-body"> 1267 Nessun prodotto nel carrello 1268 </div> 1269 <button type="button" class="btn-close btn-close-white me-2 m-auto" data-bs-dismiss="toast" aria-label="Close"></button> 1270 </div> 1271 </div> 1272 1273</div> 1274 1275 1276 1277<!-- Auto complete Google place api (new) nel file google-place-api-js -->
1278<script> 1279 (g => { 1280 var h, a, k, p = "The Google Maps JavaScript API", c = "google", l = "importLibrary", q = "__ib__", 1281 m = document, b = window; 1282 b = b[c] || (b[c] = {}); 1283 var d = b.maps || (b.maps = {}), r = new Set, e = new URLSearchParams, 1284 u = () => h || (h = new Promise(async (f, n) => { 1285 await (a = m.createElement("script")); 1286 e.set("libraries", [...r] + ""); 1287 for (k in g) e.set(k.replace(/[A-Z]/g, t => "_" + t[0].toLowerCase()), g[k]); 1288 e.set("callback", c + ".maps." + q); 1289 a.src = `https://maps.${c}apis.com/maps/api/js?` + e; 1290 d[q] = f; 1291 a.onerror = () => h = n(Error(p + " could not load.")); 1292 a.nonce = m.querySelector("script[nonce]")?.nonce || ""; 1293 m.head.append(a) 1294 })); 1295 d[l] ? console.warn(p + " only loads once. Ignoring:", g) : d[l] = (f, ...n) => r.add(f) && u().then(() => d[l](f, ...n)) 1296 })({ 1297 key: "AIzaSyB-wkGRNagymZtUJCPN6zFXDgHJRvUu-b8", 1298 v: "weekly", 1299 }); 1300</script>
vendor: 1 bytes, line 1300
1300
1301<script src="/inc/custom/js/google-place-api.js?v=tTNp8Pd1ppwAWcMWLcOXOxbAuRWZ5hTB_wUwXFX0SgU" defer></script>
1301 1302 1303<!-- Toast -->
1304<script src="/inc/custom/js/toast.js?v=kk_vZ2jsRKTfJyiI-bd-ZsATDfj7c9hY6q-xu5Z0D3A"></script>
1304 1305 1306<!-- DataLayer add_shipping_info & add_payment_info -->
1307<script> 1308 document.addEventListener('htmx:afterRequest', ({ detail }) => { 1309 if (!detail.requestConfig?.elt?.hasAttribute('data-gtm-shipping')) return; 1310 1311 const gtmData = document.getElementById('shipping-tab')?.dataset.gtm; 1312 if (gtmData) { 1313 gtmDataHandler(JSON.parse(gtmData)); 1314 } 1315 }); 1316 document.addEventListener('htmx:afterRequest', ({ detail }) => { 1317 if (!detail.requestConfig?.elt?.hasAttribute('data-gtm-payment')) return; 1318 1319 const gtmData = document.getElementById('checkoutPayment')?.dataset.gtm; 1320 if (gtmData) { 1321 gtmDataHandler(JSON.parse(gtmData)); 1322 } 1323 }); 1324</script>
1324 1325 1326<!-- Import apple e goggle --> 1327 1328<!-- Eventi per pagamento apple e goggle --> 1329 1330<!-- Loader -->
1331<script> 1332 document.addEventListener("DOMContentLoaded", function() { 1333 1334 document.addEventListener("htmx:beforeRequest", function(evt) { 1335 if (!evt.detail.elt.hasAttribute('hx-indicator')) { 1336 evt.detail.elt.setAttribute('hx-indicator', '#loader'); 1337 } 1338 }); 1339 1340 }); 1341</script>
1341 1342 1343<!-- Tooltips -->
1344<script> 1345 document.addEventListener("htmx:afterSettle", function() { 1346 const tooltipTriggerList = document.querySelectorAll('[data-bs-toggle="tooltip"]'); 1347 const tooltipList = [...tooltipTriggerList].map(tooltipTriggerEl => new bootstrap.Tooltip(tooltipTriggerEl)); 1348 }); 1349</script>
1349 1350 1351<!-- Details -->
1352<script> 1353 function handleDetailsMobile() { 1354 const detailsElements = document.querySelectorAll('.details-container details'); 1355 const isMobile = window.innerWidth <= 991; 1356 1357 detailsElements.forEach(details => { 1358 if (isMobile) { 1359 details.setAttribute('open', ''); 1360 } else { 1361 // Rimuovi open solo se non vuoi che sia aperto di default su desktop 1362 details.removeAttribute('open'); 1363 } 1364 }); 1365 } 1366 1367 // Esegui al caricamento e al ridimensionamento 1368 window.addEventListener('resize', handleDetailsMobile); 1369</script>
1369 1370 1371<!-- Auth -->
1372<script> 1373 function sendLoginPostRequest() { 1374 const genericLoginError = document.getElementById("genericLoginError"); 1375 genericLoginError.style.display = "none"; 1376 const loginError = document.getElementById("loginError"); 1377 loginError.style.display = "none"; 1378 1379 const email = document.getElementById("email").value; 1380 const password = document.getElementById("password").value; 1381 1382 const xhr = new XMLHttpRequest(); 1383 xhr.open("POST", "/ecomm/user.php?operation=checkLogin", true); 1384 xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); 1385 1386 xhr.onload = function() { 1387 if (xhr.status === 200) { 1388 const response = JSON.parse(xhr.responseText); 1389 if (response.result === false) { 1390 // Mostra errore con il messaggio dal server 1391 const loginError = document.getElementById("loginError"); 1392 loginError.textContent = response.message; 1393 loginError.style.display = "block"; 1394 } else if (response.result === true) { 1395 // Login OK -> ricarica pagina 1396 window.location.reload(); 1397 } 1398 return; 1399 } 1400 1401 // Qualsiasi errore (es. 400) -> messaggio generico sotto form 1402 genericLoginError.style.display = "block"; 1403 }; 1404 1405 xhr.onerror = function() { 1406 genericLoginError.style.display = "block"; 1407 }; 1408 1409 const requestData = 1410 `email=${encodeURIComponent(email)}&password=${encodeURIComponent(password)}&fromCheckout=S`; 1411 xhr.send(requestData); 1412 } 1413 1414 1415 function sendPasswordRecoveryRequest() { 1416 const passwordRecoveryMessage = document.getElementById("passwordRecoveryMessage"); 1417 passwordRecoveryMessage.style.display = "none"; 1418 const genericErrorPasswordRecovery = document.getElementById("genericErrorPasswordRecovery"); 1419 genericErrorPasswordRecovery.style.display = "none"; 1420 1421 const email = document.getElementById("recovery-email").value; 1422 const xhr = new XMLHttpRequest(); 1423 xhr.open("POST", "/ecomm/user.php", true); 1424 xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); 1425 1426 xhr.onload = function() { 1427 if (xhr.status === 200) { 1428 passwordRecoveryMessage.style.display = "block"; 1429 return; 1430 } 1431 genericErrorPasswordRecovery.style.display = "block"; 1432 1433 }; 1434 1435 xhr.onerror = function() { 1436 genericErrorPasswordRecovery.style.display = "block"; 1437 }; 1438 1439 const requestData = `email=${encodeURIComponent(email)}&operation=recuperaPwd&ajax=1`; 1440 xhr.send(requestData); 1441 } 1442</script>
1442 1443 1444<!-- Gestione Form -->
1445<script> 1446 (() => { 1447 if (window.__checkoutBound) return; 1448 window.__checkoutBound = true; 1449 1450 let prevIsAzienda = null; // stato precedente (true/false) per capire la transizione 1451 1452 function toggleVisibility(element, show) { 1453 if (!element) return; 1454 element.classList.toggle('d-none', !show); 1455 } 1456 1457 function getShippingMap() { 1458 return { 1459 InStorePickup: 'shop', 1460 HomeDelivery: 'delivery', 1461 BrtPickupPoint: 'brt' 1462 }; 1463 } 1464 1465 function getIsAziendaFromDom() { 1466 const userTypeContainer = document.getElementById('user-type'); 1467 const selectedTypeValue = userTypeContainer?.querySelector('input:checked')?.value; 1468 return selectedTypeValue === '1'; // azienda=1, privato=2 1469 } 1470 1471 function handleUserTypeChange() { 1472 const checkoutInvoice = document.querySelector('.checkout-invoice'); 1473 const checkboxInvoice = checkoutInvoice?.querySelector('input[type="checkbox"]'); 1474 1475 const isAzienda = getIsAziendaFromDom(); 1476 1477 // init del prev se è la prima volta 1478 if (prevIsAzienda === null) prevIsAzienda = isAzienda; 1479 1480 // Se passo da Azienda -> Privato: reset checkbox fattura 1481 if (prevIsAzienda === true && isAzienda === false && checkboxInvoice) { 1482 checkboxInvoice.readOnly = false; 1483 checkboxInvoice.checked = false; 1484 } 1485 1486 prevIsAzienda = isAzienda; 1487 1488 // poi riallineo tutta la UI 1489 refreshCheckoutUI(); 1490 } 1491 1492 function refreshCheckoutUI() { 1493 const shippingTab = document.getElementById('shipping-tab'); 1494 const shippingContent = document.getElementById('shipping-content'); 1495 const formFatturazioneCont = document.getElementById('form-fatturazione-cont'); 1496 //const formFatturazione = document.getElementById('form-fatturazione'); 1497 const checkFattSped = document.getElementById('check-fatt-sped'); 1498 const userTypeContainer = document.getElementById('user-type'); 1499 const formFattura = document.getElementById('form-fattura'); 1500 const checkoutInvoice = document.querySelector('.checkout-invoice'); 1501 1502 1503 // 1) Active shipping dal DOM 1504 let activeShipping = null; 1505 const activeButton = shippingTab?.querySelector('button.active'); 1506 1507 if (activeButton?.id) { 1508 const shippingType = activeButton.id.replace('shipping-', ''); 1509 const shippingMap = getShippingMap(); 1510 activeShipping = shippingMap[shippingType] || shippingType; 1511 toggleVisibility(shippingContent, true); 1512 1513 if (activeShipping === 'delivery') { 1514 1515 1516 document.querySelector('[data-box-fatt]')?.classList.add('d-none'); 1517 } 1518 } 1519 1520 // 2) Sezioni shipping 1521 if (shippingContent && activeShipping) { 1522 shippingContent.querySelectorAll('[data-shipping]').forEach(section => { 1523 toggleVisibility(section, section.dataset.shipping === activeShipping); 1524 }); 1525 } 1526 1527 // 3) Fatturazione = stesso indirizzo 1528 const checkboxFattSped = checkFattSped?.querySelector('input[type="checkbox"]'); 1529 if (checkboxFattSped && formFatturazioneCont) { 1530 const isDelivery = activeShipping === 'delivery'; 1531 toggleVisibility(checkFattSped, isDelivery); 1532 1533 // Se il box di riepilogo fatturazione è visibile (utente loggato, non ha cliccato "Modifica"), 1534 // NON toccare form-fatturazione-cont: la sua visibilità è gestita dal bottone "Modifica dati" 1535 const boxRiepFatt = document.getElementById('box-riep-fatt'); 1536 const summaryFattVisible = boxRiepFatt && !boxRiepFatt.classList.contains('d-none'); 1537 1538 if (!summaryFattVisible) { 1539 toggleVisibility(formFatturazioneCont, !isDelivery || !checkboxFattSped.checked); 1540 } 1541 } 1542 1543 // 4) Tipo utente + fattura 1544 const selectedTypeValue = userTypeContainer?.querySelector('input:checked')?.value; 1545 const isAzienda = selectedTypeValue === '2'; 1546 1547 const checkboxInvoice = checkoutInvoice?.querySelector('input[type="checkbox"]'); 1548 1549 if (checkboxInvoice) { 1550 if (isAzienda) { 1551 // azienda: forzo fattura ON e blocco 1552 checkboxInvoice.checked = true; 1553 checkboxInvoice.readOnly = true; 1554 } else { 1555 // privato: sblocco, ma NON resettare qui (il reset lo fai solo in handleUserTypeChange) 1556 checkboxInvoice.readOnly = false;
1557 } 1558 } 1559 1560 if (formFattura && checkboxInvoice) { 1561 toggleVisibility(formFattura, checkboxInvoice.checked); 1562 } 1563 1564 // campi condizionali data-user-type 1565 1566 formFatturazioneCont?.querySelectorAll('[data-user-type]').forEach(el => { 1567 toggleVisibility(el, el.dataset.userType === (isAzienda ? 'azienda' : 'privato')); 1568 }); 1569 1570 formFattura?.querySelectorAll('[data-user-type]').forEach(el => { 1571 toggleVisibility(el, el.dataset.userType === (isAzienda ? 'azienda' : 'privato')); 1572 }); 1573 1574 // Nascondo tasto brt se già compilato 1575 const boxRiepBrt = document.getElementById('box-riep-brt'); 1576 if (!boxRiepBrt?.classList.contains('d-none')) { 1577 document.getElementById('btn-select-brt').classList.add('d-none'); 1578 } 1579 } 1580 1581 // afterSettle: riallineo (il DOM può essere stato rimpiazzato) 1582 document.addEventListener('htmx:afterSettle', () => { 1583 // dopo swap potrebbe cambiare tipo utente "di default", quindi riallineo anche prevIsAzienda 1584 prevIsAzienda = getIsAziendaFromDom(); 1585 refreshCheckoutUI(); 1586 }); 1587 1588 // Delegation 1589 document.addEventListener('change', (e) => { 1590 // Radio tipo utente: qui faccio la logica di reset su transizione 1591 if (e.target.matches('#user-type input[type="radio"]')) { 1592 handleUserTypeChange(); 1593 return; 1594 } 1595 1596 // Checkbox "usa stesso indirizzo" 1597 if (e.target.matches('#check-fatt-sped input[type="checkbox"]')) { 1598 refreshCheckoutUI(); 1599 return; 1600 } 1601 1602 // Checkbox "desidero ricevere fattura" 1603 if (e.target.matches('.checkout-invoice input[type="checkbox"]')) { 1604 refreshCheckoutUI(); 1605 return; 1606 } 1607 }); 1608 1609 document.addEventListener('DOMContentLoaded', () => { 1610 prevIsAzienda = getIsAziendaFromDom(); 1611 refreshCheckoutUI(); 1612 1613 const collapseEl = document.getElementById('collapseScegliPassword'); 1614 const btnClose = document.getElementById('btnCloseScegliPassword'); 1615 const passwordInput = document.getElementById('password'); 1616 const passwordConfirmInput = document.getElementById('passwordConfirm'); 1617 1618 if (collapseEl && btnClose) { 1619 const bsCollapse = new bootstrap.Collapse(collapseEl, { toggle: false }); 1620 1621 // Abilita i campi quando il collapse si apre 1622 collapseEl.addEventListener('show.bs.collapse', function() { 1623 passwordInput.disabled = false; 1624 passwordConfirmInput.disabled = false; 1625 }); 1626 1627 // Disabilita i campi quando il collapse si chiude 1628 collapseEl.addEventListener('hide.bs.collapse', function(event) { 1629 if (passwordInput?.value || passwordConfirmInput?.value) { 1630 event.preventDefault(); 1631 return; 1632 } 1633 passwordInput.disabled = true; 1634 passwordConfirmInput.disabled = true; 1635 }); 1636 1637 btnClose.addEventListener('click', function() { 1638 passwordInput.value = ''; 1639 passwordConfirmInput.value = ''; 1640 passwordInput.disabled = true; 1641 passwordConfirmInput.disabled = true; 1642 bsCollapse.hide(); 1643 }); 1644 } 1645 }); 1646 })(); 1647</script>
1647 1648 1649<!-- Gestione box riepilogo indirizzo di fatturazione -->
1650<script> 1651 let statoFatt = false; 1652 1653 function showFormFatt(button) { 1654 document.getElementById('form-fatturazione-cont').classList.remove('d-none'); 1655 button.closest('#box-riep-fatt')?.classList.add('d-none'); 1656 statoFatt = true; 1657 } 1658 1659 function getShippingMap() { 1660 return { 1661 InStorePickup: 'shop', 1662 HomeDelivery: 'delivery', 1663 BrtPickupPoint: 'brt' 1664 }; 1665 } 1666 1667 document.addEventListener('htmx:afterSettle', () => { 1668 const shippingTab = document.getElementById('shipping-tab'); 1669 1670 let activeShipping = null; 1671 const activeButton = shippingTab?.querySelector('button.active'); 1672 1673 if (activeButton?.id) { 1674 const shippingType = activeButton.id.replace('shipping-', ''); 1675 const shippingMap = getShippingMap(); 1676 activeShipping = shippingMap[shippingType] || shippingType; 1677 1678 } 1679 1680 if (activeShipping === "delivery") { 1681 document.getElementById('box-riep-fatt')?.classList.add('d-none'); 1682 1683 const emailBillingField = document.querySelector('#form-fatturazione-cont [name="BillingAddress.Email"]'); 1684 emailBillingField?.closest('.col-12')?.classList.add('d-none'); 1685 1686 return; 1687 } 1688 1689 if (activeShipping === "shop" || activeShipping === "brt") { 1690 // Ripristina il campo indirizzo 1691 const emailBillingField = document.querySelector('#form-fatturazione-cont [name="BillingAddress.Email"]'); 1692 emailBillingField?.closest('.col-12')?.classList.remove('d-none'); 1693 1694 if (true) { 1695 document.getElementById('form-fatturazione-cont').classList.remove('d-none'); 1696 document.getElementById('box-riep-fatt')?.classList.add('d-none'); 1697 return; 1698 } else { 1699 if (statoFatt) { 1700 document.getElementById('form-fatturazione-cont').classList.remove('d-none'); 1701 document.getElementById('box-riep-fatt')?.classList.add('d-none'); 1702 } else { 1703 document.getElementById('form-fatturazione-cont').classList.add('d-none'); 1704 } 1705 } 1706 } 1707 1708 }); 1709</script>
1709 1710 1711<!-- Gestione box riepilogo indirizzo di spedizione -->
1712<script> 1713 let statoIndSped = false; 1714 1715 function showIndSped(button) { 1716 document.getElementById('shipping-address-form-cont').classList.remove('d-none'); 1717 button.closest('#box-riep-ind-sped').classList.add('d-none'); 1718 statoIndSped = true; 1719 } 1720 1721 document.addEventListener('htmx:afterSettle', () => { 1722 if (statoIndSped) { 1723 document.getElementById('shipping-address-form-cont').classList.remove('d-none'); 1724 document.getElementById('box-riep-ind-sped').classList.add('d-none'); 1725 } 1726 }); 1727</script>
1727 1728 1729<!-- Gestione indirizzi Brt -->
1730<script> 1731 document.addEventListener('click', function(e) { 1732 const btn = e.target.closest('.confirm-brt-btn'); 1733 if (!btn) return; 1734 1735 const id = btn.dataset.pudoId; 1736 const name = btn.dataset.pudoName; 1737 const address = btn.dataset.pudoAddress; 1738 1739 document.getElementById('master_BRT_PUDO_ID').value = id; 1740 document.getElementById('master_BRT_PUDO_NAME').value = name; 1741 document.getElementById('master_BRT_PUDO_ADDRESS').value = address; 1742 1743 document.getElementById('brt-selected-name').textContent = name; 1744 document.getElementById('brt-selected-address').textContent = address; 1745 1746 document.getElementById('box-riep-brt').classList.remove('d-none'); 1747 document.getElementById('btn-select-brt').classList.add('d-none'); 1748 bootstrap.Modal.getInstance(document.getElementById('modalBRT')).hide(); 1749 }); 1750</script>
1750 1751 1752<!-- Insider checkout_started --> 1753
1754<script> 1755 window.insiderData.checkout_started = { 1756 type: 'custom_event', 1757 value: [{ 1758 event_name: 'checkout_started', 1759 event_parameters: { 1760 quantity: 0, 1761 custom: { 1762 checkout_step: 'shipping', 1763 cart_total: 0, 1764 currency: 'EUR' 1765 } 1766 } 1767 }] 1768 }; 1769 1770 window.insiderData.currency = { 1771 type: 'currency', 1772 value: 'EUR' 1773 }; 1774</script>
1774 1775 1776 1777 <div class="htmx-indicator" id="loader"> 1778 <span class="loader"></span> 1779</div> 1780 1781 <!-- GTM Data Helpers --> 1782
1782<script src="/inc/custom/js/gtmDataHelpers.js"></script>
1782 1783 1784
1784<script> 1785 document.addEventListener("htmx:configRequest", (evt) => { 1786 let httpVerb = evt.detail.verb.toUpperCase(); 1787 if (httpVerb === 'GET') return; 1788 1789 let antiForgery = htmx.config.antiForgery; 1790 1791 if (antiForgery) { 1792 1793 // already specified on form, short circuit 1794 if (evt.detail.parameters[antiForgery.formFieldName]) 1795 return; 1796 1797 if (antiForgery.headerName) { 1798 evt.detail.headers[antiForgery.headerName] 1799 = antiForgery.requestToken; 1800 } else { 1801 evt.detail.parameters[antiForgery.formFieldName] 1802 = antiForgery.requestToken; 1803 } 1804 } 1805 }); 1806 1807 </script>
1807 1808 1809 <!-- Bootstrap JS --> 1810
1810<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-FKyoEForCGlyvwx9Hj09JcYn3nv7wiPVlz7YYwJrWVcXK/BmnVDxM+D2scQbITxI" crossorigin="anonymous"></script>
1810 1811 1812 <!-- Swiper JS --> 1813
1813<script src="https://cdn.jsdelivr.net/npm/swiper@12/swiper-bundle.min.js" integrity="sha384-TmUUNA9gRm9TspAqMh20CdxlcwkNFW3UyIOibSljonhpJ1UfGenJDyQvO/EbWwpW" crossorigin="anonymous"></script>
1813 1814 1815 <!-- jquery--> 1816
1816<script src="https://code.jquery.com/jquery-4.0.0.min.js" integrity="sha256-OaVG6prZf4v69dPg6PhVattBXkcOWQB62pdZ3ORyrao=" crossorigin="anonymous"></script>
1816 1817 1818 <!-- Ecomm Umb--> 1819
1819<script type="text/javascript" src="/inc/js/ecomm-umb.js?v=dKXm9AK40S_n-woncl4LOt7rwSgbEFPhwpLqk8AzLds"></script>
1819 1820 1821 <!-- Push datalayer gtm --> 1822
1822<script type="text/javascript" src="/libs/google/gtm/gtm-direct.js"></script>
1822 1823 1824 1825 1826 1827
1828<script> 1829 (function () { 1830 console.log('=== INIZIO VERIFICA INSIDER DATA ==='); 1831 1832 let ORDINE_PREFERITO; 1833 1834 ORDINE_PREFERITO =["checkout", "currency", "user", "checkout_started", "init"]; 1835 1836 function verificaEPusha() { 1837 if (!window.insiderData) return false; 1838 1839 if (!ORDINE_PREFERITO) { 1840 window.insiderData.other_page = { 1841 "type": "other", 1842 "value": [window.location.pathname] 1843 }; 1844 ORDINE_PREFERITO = ['other_page', 'user', 'init']; 1845 } 1846 1847 let elementiPresenti = Object.keys(window.insiderData); 1848 1849 if (!elementiPresenti.includes('user')) { 1850 console.log('In attesa di user...'); 1851 return false; 1852 } 1853 1854 window.insiderData.init = {"type": "init"}; 1855 elementiPresenti = [...elementiPresenti, 'init']; 1856 1857 console.log('Elementi disponibili (con init):', elementiPresenti); 1858 1859 const ordineFiltrato = ORDINE_PREFERITO.filter(item => elementiPresenti.includes(item)); 1860 1861 console.log('Ordine di push finale:', ordineFiltrato); 1862 1863 ordineFiltrato.forEach(tipo => { 1864 if (window.insiderData[tipo]) { 1865 window.InsiderQueue.push(window.insiderData[tipo]); 1866 console.log(`â Push completato per ${tipo}:`, window.insiderData[tipo]); 1867 } else { 1868 console.error(`Elemento ${tipo} non trovato in insiderData`); 1869 } 1870 }); 1871 1872 console.log('Stato finale InsiderQueue:', window.InsiderQueue); 1873 return true; 1874 } 1875 1876 let tentativi = 0; 1877 const maxTentativi = 20; 1878 1879 const interval = setInterval(function () { 1880 tentativi++; 1881 console.log('Tentativo:', tentativi); 1882 1883 if (verificaEPusha() || tentativi >= maxTentativi) { 1884 clearInterval(interval); 1885 console.log('Operazione completata o timeout raggiunto'); 1886 } 1887 }, 500); 1888 })(); 1889</script>
1889 1890 1891 1892 1893
1893<script> 1894 (function() { 1895 // 1. Disabilita focus-scroll automatico di HTMX 1896 htmx.config.defaultFocusScroll = false; 1897 1898 // 2. Salva e ripristina posizione scroll attorno a ogni request 1899 let savedY = 0; 1900 document.addEventListener('htmx:beforeRequest', () => savedY = window.scrollY); 1901 document.addEventListener('htmx:afterSettle', () => window.scrollTo({ top: savedY, behavior: 'instant' })); 1902 })(); 1903 1904 </script>
1904 1905 1906 <!-- Usercentrics -->
1907<script id="usercentrics-cmp" src="https://app.usercentrics.eu/browser-ui/latest/loader.js" data-settings-id="PBc5TNNzu"></script>
1907 1908<!-- End Usercentrics --> 1909 1910</body> 1911 1912</html>
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.