Gamme di prodotti per professionisti - Würth Italia (2025)

    • Categorie di prodotti
    • DIN catalog
    • ISO catalog
    • PRODOTTI NUOVI
    • Automatic Store Sommacampagna
    • Utensili
    • Würth Hydro

'; } content += '

'; wuerthitaly_activeSlider('.product-gallery', true, 1, 1, true, false, 0, true); } } content += '

'; // titolo content += '' + prodotti[i]['name'] + ''; // prezzo content += ' '; // btn content += ''; content += 'NEL CARRELLO '; content += ''; content += '

'; } if (prodotti[i]['type'] == 1) { // è una famiglia prodotto // immagine if (Array.isArray(prodotti[i]['img']) == false) { content += ''; content += ''; content += ''; wuerthitaly_getImage(prodotti[i]['img'].trim(), id_section + '_' + i, '576', prodotti[i]['img'].trim(), prodotti[i]['size'], kam); } else { if (prodotti[i]['img'].length > 1) { content += '

'; for (j = 0; j < prodotti[i]['img'].length; j++) { content += '

'; content += ''; content += ''; content += ''; content += '

'; } content += '

'; wuerthitaly_activeSlider('.product-gallery', true, 1, 1, true, false, 0, true); } } content += '

'; // titolo content += '' + prodotti[i]['name'] + ''; // prezzo content += ''; // btn content += ''; content += 'SCOPRI IL PRODOTTO '; content += ''; content += '

'; } if (prodotti[i]['type'] == 2) { // è un contenuto personalizzato // immagine content += ''; content += ''; content += ''; content += '

'; // titolo content += '' + prodotti[i]['name'] + ''; content += ''; // btn if (btn_text != '') { content += ''; content += btn_text; content += ''; } content += '

'; } content += '

'; content += '

'; } } else { content += '

'; content += '

'; // immagine content += ''; content += ''; content += ''; // titolo content += '' + prodotti[i]['name'] + ''; // prezzo content += ' '; // btn content += ''; content += 'NEL CARRELLO '; content += ''; wuerthitaly_getImage(prodotti[i]['sku'].trim(), i, '576', prodotti[i]['size'], kam); content += '

'; content += '

'; } } } if (tipologia === 'modern') { // console.log('modern'); // console.log(wuerthitaly_getColumnNumber(col)); var src = ""; var i, j; for (i = 0; i < prodotti.length; i++) { if (prodotti[i]['from'] !== '' && prodotti[i]['to'] !== '') { if (wuerthitaly_dateCheck(prodotti[i]['from'], prodotti[i]['to']) == 'current') { content += '

'; content += '

'; content += '

'; content += ''; content += ''; content += ''; content += ' '; content += '' + prodotti[i]['name'] + ''; content += '

'; content += '

'; content += '' + prodotti[i]['name'] + ''; content += ''; content += 'NEL CARRELLO '; content += ''; wuerthitaly_getImage(prodotti[i]['sku'].trim(), i, '576'); content += '

'; content += '

'; content += '

'; } } else { content += '

'; content += '

'; content += '

'; content += ''; content += ''; content += ''; content += ' '; content += '' + prodotti[i]['name'] + ''; content += '

'; content += '

'; content += '' + prodotti[i]['name'] + ''; content += ''; content += 'NEL CARRELLO '; content += ''; wuerthitaly_getImage(prodotti[i]['sku'].trim(), i, '576'); content += '

'; content += '

'; content += '

'; } } } if (tipologia === 'filter') { // console.log('filter'); var content = 'filter'; } if (tipologia === 'slider') { //// console.log('slider attiva'); //// console.log(prodotti); for (i = 0; i < prodotti.length; i++) { // console.log('prodotti' + cookie_divisione); // console.log('segmento' + cookie_segmento); if (prodotti[i]['divisione'] == cookie_divisione) { if (prodotti[i]['segmento'] == cookie_segmento) { if (prodotti[i]['from'] !== '' && prodotti[i]['to'] !== '') { if (wuerthitaly_dateCheck(prodotti[i]['from'], prodotti[i]['to']) == 'current') { content += '

'; content += '

'; if (tracking_code != undefined) { var insert_track_img = ' class="track_click" id="product_img_' + tracking_code + '_' + i + '"'; var insert_track_link = ' class="track_click ' + title_style + '" id="product_link_' + tracking_code + '_' + i + '"'; } else { var insert_track_img = ' class=""'; var insert_track_link = ' class="' + title_style + '"'; } if (prodotti[i]['type'] == 0) { // è un prodotto // immagine if (Array.isArray(prodotti[i]['img']) == false) { content += '

'; content += '

'; content += '

'; content += ''; content += ''; content += ''; content += '

'; content += '

'; content += '

'; wuerthitaly_getImage(prodotti[i]['sku'].trim(), id_section + '_' + i, '576', prodotti[i]['img'].trim(), prodotti[i]['size'], kam); } else { if (prodotti[i]['img'].length > 0) { content += '

'; content += '

'; content += '

'; content += '

'; for (j = 0; j < prodotti[i]['img'].length; j++) { content += '

'; content += ''; content += ''; content += ''; content += '

'; } content += '

'; content += '

'; content += '

'; content += '

'; wuerthitaly_activeSlider('.product-gallery', true, 1, 1, true, false, 0, true); } } content += '

'; content += '

'; content += '

'; content += '

'; // titolo content += '' + prodotti[i]['name'] + ''; // prezzo content += ' '; // btn content += ''; content += 'NEL CARRELLO '; content += ''; content += '

'; content += '

'; content += '

'; content += '

'; } if (prodotti[i]['type'] == 1) { // è una famiglia prodotto // immagine if (Array.isArray(prodotti[i]['img']) == false) { content += '

'; content += '

'; content += '

'; content += ''; content += ''; content += ''; content += '

'; content += '

'; content += '

'; } else { if (prodotti[i]['img'].length > 1) { content += '

'; content += '

'; content += '

'; content += '

'; for (j = 0; j < prodotti[i]['img'].length; j++) { content += '

'; content += ''; content += ''; content += ''; content += '

'; } content += '

'; content += '

'; content += '

'; content += '

'; wuerthitaly_activeSlider('.product-gallery', true, 1, 1, true, false, 0, true); } } content += '

'; content += '

'; content += '

'; content += '

'; // titolo content += '' + prodotti[i]['name'] + ''; // prezzo content += ''; // btn content += ''; content += 'SCOPRI IL PRODOTTO '; content += ''; content += '

'; content += '

'; content += '

'; content += '

'; } if (prodotti[i]['type'] == 2) { // è un contenuto personalizzato // immagine content += '

'; content += '

'; content += '

'; content += ''; content += ''; content += ''; content += '

'; content += '

'; content += '

'; content += '

'; content += '

'; content += '

'; content += '

'; // titolo content += '' + prodotti[i]['name'] + ''; content += ''; // btn if (btn_text != '') { content += ''; content += btn_text; content += ''; } content += '

'; content += '

'; content += '

'; content += '

'; } content += '

'; content += '

'; } } } } } //wuerthitaly_activeSlider('.prodottinuovi-gallery', false, 4, 1, false, false, 0, true); } if (tipologia === 'carousel') { var src = ""; var i, j; content += '

'; content += '

'; content += '

'; content += '

'; for (i = 0; i < prodotti.length; i++) { content += '

'; content += '

'; if (prodotti[i]['from'] !== '' && prodotti[i]['to'] !== '') { if (wuerthitaly_dateCheck(prodotti[i]['from'], prodotti[i]['to']) == 'current') { content += '

'; content += '

'; if (prodotti[i]['type'] == 0) { // è un prodotto // immagine if (Array.isArray(prodotti[i]['img']) == false) { content += ''; content += ''; content += ''; wuerthitaly_getImage(prodotti[i]['sku'].trim(), id_section + '_' + i, '576', prodotti[i]['img'].trim(), prodotti[i]['size'], kam); } else { if (prodotti[i]['img'].length > 1) { content += '

'; for (j = 0; j < prodotti[i]['img'].length; j++) { content += '

'; content += ''; content += ''; content += ''; content += '

'; } content += '

'; wuerthitaly_activeSlider('.product-gallery', true, 1, 1, true, false, 0, true); } } content += '

'; //content += '

'; content += '' + prodotti[i]['name'] + ''; //content += '

'; // titolo // prezzo content += ' '; // btn content += ''; content += 'nel carrello '; content += ''; content += '

'; } if (prodotti[i]['type'] == 1) { // è una famiglia prodotto // immagine if (Array.isArray(prodotti[i]['img']) == false) { content += ''; content += ''; content += ''; wuerthitaly_getImage(prodotti[i]['img'].trim(), id_section + '_' + i, '576', prodotti[i]['img'].trim(), prodotti[i]['size'], kam); } else { if (prodotti[i]['img'].length > 1) { content += '

'; for (j = 0; j < prodotti[i]['img'].length; j++) { content += '

'; content += ''; content += ''; content += ''; content += '

'; } content += '

'; wuerthitaly_activeSlider('.product-gallery', true, 1, 1, true, false, 0, true); } } content += '

'; // titolo //content += '

'; content += '' + prodotti[i]['name'] + ''; //content += '

'; // prezzo content += ''; // btn content += ''; content += 'SCOPRI IL PRODOTTO '; content += ''; content += '

'; } if (prodotti[i]['type'] == 2) { // è un contenuto personalizzato // immagine content += ''; content += ''; content += ''; content += '

'; // titolo content += '' + prodotti[i]['name'] + ''; content += ''; // btn if (btn_text != '') { content += ''; content += btn_text; content += ''; } content += '

'; } content += '

'; content += '

'; } } else { content += '

'; content += '

'; // immagine content += ''; content += ''; content += ''; // titolo content += '' + prodotti[i]['name'] + ''; // prezzo content += ' '; // btn content += ''; content += 'nel carrello '; content += ''; wuerthitaly_getImage(prodotti[i]['sku'].trim(), i, '576', prodotti[i]['size'], kam); content += '

'; content += '

'; } content += '

'; content += '

'; } content += '

'; content += '

'; content += '

'; content += '

'; } return content; } function wuerthitaly_activeSlider(element, infinite, s2show, s2Scroll, dots, autoplay, autoplaySpeed, arrows) { $(document).ready(function () { var $slider = $(element); $slider.slick({ 'infinite': infinite, 'slidesToShow': s2show, 'slidesToScroll': s2Scroll, 'dots': dots, 'autoplay': autoplay, 'autoplaySpeed': autoplaySpeed, 'arrows': arrows, 'draggable': false, 'responsive': [ { 'breakpoint': 768, 'settings': { 'slidesToShow': 1, 'slidesToScroll': 1 } }, { 'breakpoint': 480, 'settings': { 'slidesToShow': 1, 'slidesToScroll': 1 } } // You can unslick at a given breakpoint now by adding: // settings: "unslick" // instead of a settings object ] }); }); } /* DEV LINTING GG */ /** * * @param { string } cmp - ID Component * @param { boolean } cookie - Cookie Banner visibility (probabilmente non serve più) * @param { boolean } live - Live or edit mode * @param { boolean } wp - Welcome Page * @param { boolean } kam - Remove nav e-shop items * @param { boolean } kam_footer - Footer KAM pages (old) * @param { string } url - Url for redirect (default undefined) * @param { string } loginID - ID of the element to clone the login form (default undefined) */ function wuerthitaly_clearPage(cmp, cookie, live, wp, kam, kam_footer, url, loginID, stickyElementID = '.filtermenu') { // if (live === 1) { // var css = '#cmp_20190221_155749'; // var js = '#cmp_20190222_085625'; // } else { // var css = '#cmp_20190305_115257'; // var js = '#cmp_20190305_115612'; // } if (wp === 1) { $('#appFrameCol3').removeClass('col-md-9'); $('#appFrameCol3').addClass('col-md-12'); $(".side-nav").remove(); $('.canvas-container.main_page').appendTo('.welcome_user'); // Per clienti che aggiungono al carrello ma poi deve essere approvato da utente admin $('.side-nav .card').appendTo('.approvazione_carrello'); } // $(css).removeClass('mb-4'); // $(js).removeClass('mb-4'); // $(css).css({ "min-height": "0" }); // $(js).css({ "min-height": "0" }); $('#main-wrapper').removeClass('mt-4'); $('[id^=cmp_]').each(function () { $(this).removeClass('mb-4'); $(this).addClass('px-0'); $(this).appendTo('#main-wrapper'); $(this).css('min-height', '0px'); }); $('.main').remove(); // controllo $('.canvas-container.main_page').remove(); // controllo if (kam === 1) { $('.header-usp').remove(); $('.link-negozi').remove(); $('.link-cataloghi').remove(); $('.link-azienda').remove(); $('.link-lavora').remove(); if (kam_footer === 1) { $('#cmp_20181008_120842').appendTo('#main-wrapper'); // Old footer si potrà togliere } wuerthitaly_setCookie('kam_page', 1, 7); } // if (cookie !== 0) { // $('#cookieBanner').remove(); // } document.onreadystatechange = function () { //console.log("document state: ", document.readyState); if (document.readyState == "complete") { // redirect login (al login l'utente viene reindirizzato sulla pagina) /*if ($('#shopCustomerNo').length > 0 && wuerthitaly_getCookie('redirect').length > 0) { if(wuerthitaly_getCookie('redirect').includes('ViewCurrentReq-UnregisterPageable')){ const redirectTo = wuerthitaly_getCookie('redirect') window.location = redirectTo } if (wuerthitaly_getCookie('redirect').length > 0) { wuerthitaly_setCookie("redirect", "", 365); } } else { if (!(window.location.href === "https://eshop.wuerth.it/it/IT/EUR/") ) { wuerthitaly_setCookie("redirect", url ? url : window.location.href, 7); } // copio il box del login e lo metto in un div con id che viene passato, se viene passato if (loginID) { $('.header-user-content').clone().appendTo(loginID); $('.header-user-content').css({ 'opacity': 1 }); $('.header-user-content > div').css({ 'opacity': 1 }); } }*/ // Smooth Scroll (onload perché aspetto che gli elementi vengano renderizzati) $('a[href*="#"]') .not('[href="#"]') .not('[href="#0"]') .click(function (event) { if (location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') && location.hostname == this.hostname) { var target = $(this.hash); target = target.length ? target : $('[name=' + this.hash.slice(1) + ']'); if (target.length) { event.preventDefault(); let howToScroll = 0; let stickyHeight = $(stickyElementID).height(); if (window.outerWidth < 991) { howToScroll = target.offset().top - (stickyHeight ? stickyHeight : 0); } else { howToScroll = target.offset().top - $('#headerSearch').height() - (stickyHeight ? stickyHeight : 0); } $('html, body').animate({ scrollTop: howToScroll }, 1000, "easeInCubic", function () { $(target).focus(); }); } } }); // Copy Coupon Popover $('[data-toggle="popover"]').popover(); // Se ID nell'url allora scroll in posizione dell'elemento con lo stesso ID if (window.location.hash) { let el = document.querySelector("#" + CSS.escape(window.location.hash.split("#")[1])); if (el) { el.scrollIntoView(true); } } } } } /** * * @param { string } id - Identifier button "Copy coupon" */ function wuerth_copyCouponCode(id) { var copyText = $('#' + id).text(); var textArea = document.createElement("textarea"); textArea.value = copyText; document.body.appendChild(textArea); textArea.select(); document.execCommand("Copy"); textArea.remove(); $('[data-coupon="' + id + '"]').attr('data-content', 'Coupon copiato!'); $('[data-coupon="' + id + '"]').popover("hide"); $('[data-coupon="' + id + '"]').popover("show"); } /** * * @param { string } id - Identifier button "Copy coupon" */ function wuerth_copyCouponCode2022(id) { var copyText = $('[data-label-coupon="' + id + '"]')[0].innerText; var textArea = document.createElement("textarea"); textArea.value = copyText; document.body.appendChild(textArea); textArea.select(); if (!textArea.value.includes("Coupon copiato!")) { document.execCommand("Copy"); } textArea.remove(); var copied = $('[data-copied-coupon="' + id + '_copied"]'); var button = $('[data-button-coupon="' + id + '_button"]'); copied.removeClass("d-none"); copied.addClass("d-flex"); button.removeClass("d-flex"); button.addClass("d-none"); setTimeout(() => { copied.removeClass("d-flex"); copied.addClass("d-none"); button.removeClass("d-none"); button.addClass("d-flex"); }, 1000); } /** * * @param { object } el - Clicked element */ function wuerthitaly_selectTaglieCoupon(el, identificator) { var coupon = $(el).attr('rel'); var code_button = document.querySelectorAll(".couponTaglia." + identificator + " > .coupon_container button.coupon_btn"); var code_div = document.querySelectorAll(".couponTaglia." + identificator + " > .coupon_container div.coupon_btn"); var code_label = document.querySelectorAll(".couponTaglia." + identificator + " > .coupon_container button.coupon_btn .coupon_code_text"); $('.couponTaglia.' + identificator + ' .coupon_container').css('visibility', 'visible'); $('.couponTaglia.' + identificator + ' .couponTagliaSelector a').removeClass('active'); code_label.forEach(label => { label.innerText = coupon; label.dataset.labelCoupon = coupon; }); code_button.forEach(button => { button.dataset.buttonCoupon = coupon + "_button"; button.setAttribute("onclick", "wuerth_copyCouponCode2022('" + coupon + "')"); }); code_div.forEach(div => { div.dataset.copiedCoupon = coupon + "_copied"; }); $('.couponTaglia.' + identificator + ' .size_button[rel=' + coupon + ']').addClass('active'); } /** * * @param { string } id - Identifier button "Copy coupon" */ function wuerth_infoCouponCode(id) { $('[data-coupon="' + id + '"]').attr('data-content', 'Copia il coupon'); } function wuerthitaly_getColumnNumber(col) { if (col === 12) { var colonne = 'col-12 col-sm-12 col-md-12 col-lg-12 col-xl-12'; } if (col === 6) { var colonne = 'col-6 col-sm-6 col-md-3 col-lg-2 col-xl-2'; } if (col === 4) { var colonne = 'col-6 col-sm-6 col-md-6 col-lg-3 col-xl-3'; } if (col === 3) { var colonne = 'col-12 col-sm-6 col-md-6 col-lg-4 col-xl-4'; } if (col === 2) { var colonne = 'col-6 col-sm-6 col-md-6 col-lg-6 col-xl-6'; } return colonne; } function wuerthitaly_openGridCardLink(cta) { if (!cta.includes('eshop.wuerth.it')) window.open(cta, '_blank'); else window.location.href = cta; } function wuerthitaly_dateCheck(from, to) { var fDate = wuerthitaly_dateFunction(from, 'time'); var tDate = wuerthitaly_dateFunction(to, 'time'); var cDate = new Date().getTime(); if ((cDate <= tDate && cDate >= fDate)) { return 'current'; } else { if ((cDate < tDate && cDate < fDate)) { return 'after'; } if ((cDate > tDate && cDate > fDate)) { return 'before'; } } return fDate + ' ' + tDate + ' ' + cDate; } function wuerthitaly_dateFunction(value, params) { var arr = value.split("/"); if (params == 'time') { var result = new Date(arr[2], (arr[1] - 1), arr[0], arr[3], arr[4], arr[5], arr[6]).getTime(); } if (params == 'day') { var result = arr[0] + ' ' + wuerthitaly_nomeMese(arr[1], 'full') + ' ' + arr[2]; } if (params == 'hour') { var result = arr[3] + ':' + arr[4] + ':' + arr[5]; } if (params == 'timer') { var result = arr[2] + '-' + arr[1] + '-' + arr[0] + '+' + arr[3] + ':' + arr[4] + ':' + arr[5]; } return result; } function wuerthitaly_nomeMese(value, params) { if (params == 'full') { if (value == '01') { return 'Gennaio'; } if (value == '02') { return 'Febbraio'; } if (value == '03') { return 'Marzo'; } if (value == '04') { return 'Aprile'; } if (value == '05') { return 'Maggio'; } if (value == '06') { return 'Giugno'; } if (value == '07') { return 'Luglio'; } if (value == '08') { return 'Agosto'; } if (value == '09') { return 'Settembre'; } if (value == '10') { return 'Ottobre'; } if (value == '11') { return 'Novembre'; } if (value == '12') { return 'Dicembre'; } } if (params == 'abbr') { if (value == '01') { return 'Gen'; } if (value == '02') { return 'Feb'; } if (value == '03') { return 'Mar'; } if (value == '04') { return 'Apr'; } if (value == '05') { return 'Mag'; } if (value == '06') { return 'Giu'; } if (value == '07') { return 'Lug'; } if (value == '08') { return 'Ago'; } if (value == '09') { return 'Set'; } if (value == '10') { return 'Ott'; } if (value == '11') { return 'Nov'; } if (value == '12') { return 'Dic'; } } } function wuerthitaly_getImage(sku, i, dim, src, size, kam) { // console.log(kam); $.ajax({ method: 'GET', url: 'https://www.wuerth.it/eShop/articleinfo/?productno=' + encodeURIComponent(sku.trim()), dataType: 'jsonp', success: function (data) { if (kam != undefined) { if (data.length > 0) { if (data[0]['IMAGEFILENAME'] != null) { if (size == '') { $('#img_' + i).attr('src', 'https://media.wuerth.com/stmedia/wuerth/images/std.lang.all/resolutions/category/' + dim + 'px/' + data[0]['IMAGEFILENAME']); } else { $('#img_' + i).attr('src', '/is-bin/intershop.static/WFS/3114-B1-Site/3114-B1/en_US/KAM/_products/' + src + '_' + size + '.jpg'); } } else { var img = sku.replace(/ /g, ''); if (size == '') { $('#img_' + i).attr('src', '/is-bin/intershop.static/WFS/3114-B1-Site/3114-B1/en_US/KAM/_products/' + img + '_400x400.jpg'); } else { $('#img_' + i).attr('src', '/is-bin/intershop.static/WFS/3114-B1-Site/3114-B1/en_US/KAM/_products/' + src + '_' + size + '.jpg'); } } } else { var img = sku.replace(/ /g, ''); if (size == '') { $('#img_' + i).attr('src', '/is-bin/intershop.static/WFS/3114-B1-Site/3114-B1/en_US/KAM/_products/' + img + '_400x400.jpg'); } else { $('#img_' + i).attr('src', '/is-bin/intershop.static/WFS/3114-B1-Site/3114-B1/en_US/KAM/_products/' + src + '_' + size + '.jpg'); } } } else { // console.log("normalimage") if (data.length > 0) { if (data[0]['IMAGEFILENAME'] != null) { $('#img_' + i).attr('src', 'https://media.wuerth.com/stmedia/wuerth/images/std.lang.all/resolutions/category/' + dim + 'px/' + data[0]['IMAGEFILENAME']); } else { var img = sku.replace(/ /g, ''); $('#img_' + i).attr('src', '/is-bin/intershop.static/WFS/WuerthGroup-Wuerth-Site/3114-B1/en_US/_products/' + img + '_400x400.jpg'); } } else { var img = sku.replace(/ /g, ''); $('#img_' + i).attr('src', '/is-bin/intershop.static/WFS/WuerthGroup-Wuerth-Site/3114-B1/en_US/_products/' + img + '_400x400.jpg'); } } }, }); } function wuerthitaly_SliderProdottiNuovi(cookie_divisione, array_prodottinuovi) { var info = ""; info += '

'; info += '

'; info += '

'; info += '

'; for (var i = 0; i < array_prodottinuovi.length; i++) { info += '

'; // immagine info += ''; info += ''; info += ''; // titolo info += '' + array_prodottinuovi[i]['name'] + ''; // prezzo if (array_prodottinuovi[i]['sku'] == 1) { info += ' '; } // btn if (array_prodottinuovi[i]['sku'] == 1) { info += ''; info += 'NEL CARRELLO '; info += ''; } else { info += ''; info += 'scopri il prodotto '; info += ''; } info += '

'; wuerthitaly_getImage(array_prodottinuovi[i]['sku'].trim(), i, '576', '', '', 0); } info += '

'; info += '

'; info += '

'; info += '

'; //wuerthitaly_activeSlider('.prodottinuovi-gallery', false, 4, 1, false, false, 0, true); return info; } function wuerthitaly_SliderProdottiConsigliati(cookie_divisione, array_prodotticonsigliati) { var info = ""; info += '

'; info += '

'; for (var i = 0; i < array_prodotticonsigliati.length; i++) { info += '

'; info += '

'; info += '

'; // immagine info += ''; info += ''; info += ''; // titolo info += '' + array_prodotticonsigliati[i]['name'] + ''; // prezzo if (array_prodotticonsigliati[i]['sku'] == 1) { info += ' '; } // btn if (array_prodotticonsigliati[i]['sku'] == 1) { info += ''; info += 'NEL CARRELLO '; info += ''; } else { info += ''; info += 'scopri il prodotto '; info += ''; } info += '

'; info += '

'; info += '

'; wuerthitaly_getImage(array_prodotticonsigliati[i]['sku'].trim(), i, '576', '', '', 0); wuerthitaly_activeSlider('.prodotticonsigliati-gallery', true, 8, 1, false, true, 1500, true); } info += '

'; info += '

'; return info; } function wuerthitaly_Slider(cookie_divisione, sliderimg) { var n_imgs = sliderimg.length; var ratio = 1080 / 1920; var i; var text = ""; text += '

'; if (n_imgs === 1) { var bwidth = $(window).innerWidth(); var bheight = bwidth * ratio / 2; // console.log(bwidth); // console.log(bheight); for (i = 0; i < sliderimg.length; i++) { text += '

'; text += '

'; text += '

'; text += 'SCOPRI DI PIU '; text += '

'; text += '

'; } } if (n_imgs === 2) { var bwidth = $(window).innerWidth() / 2; var bheight = bwidth * ratio; // console.log(bwidth); // console.log(bheight); for (i = 0; i < sliderimg.length; i++) { text += '

'; text += '

'; text += '

'; text += 'SCOPRI DI PIU '; text += '

'; text += '

'; } } if (n_imgs === 3) { // img principale var bwidth = $(window).innerWidth() * 7 / 12; var bheight = bwidth * ratio; // img secondarie var swidth = $(window).innerWidth() - bwidth; var sheight = bheight / 2; // console.log('bwidth: ' + bwidth); // console.log('bheight: ' + bheight); // console.log('swidth: ' + swidth); // console.log('sheight: ' + sheight); for (i = 0; i < sliderimg.length; i++) { if (sliderimg[i]['big'] === 1) { text += '

'; text += '

'; text += '

'; text += 'SCOPRI DI PIU '; text += '

'; text += '

'; } } text += '

'; text += '

'; for (i = 0; i < sliderimg.length; i++) { if (sliderimg[i]['big'] === 0) { text += '

'; text += '

'; text += '

' + sliderimg[i]['titolo'] + '

'; text += 'SCOPRI DI PIU '; text += '

'; text += '

'; } } text += '

'; text += '

'; } if (n_imgs === 4) { // img principale var bwidth = $(window).innerWidth() / 4; var bheight = bwidth * ratio * 2; // console.log(bwidth); // console.log(bheight); for (i = 0; i < sliderimg.length; i++) { text += '

'; text += '

'; text += '

'; text += 'SCOPRI DI PIU '; text += '

'; text += '

'; } } if (n_imgs === 5) { // img principale var bwidth = $(window).innerWidth() / 2; var bheight = bwidth * ratio; // img secondarie var swidth = bwidth / 2; var sheight = bheight / 2; // console.log(bwidth); // console.log(bheight); // console.log(swidth); // console.log(sheight); for (i = 0; i < sliderimg.length; i++) { if (sliderimg[i]['big'] === 1) { text += '

'; text += '

'; text += '

'; text += 'SCOPRI DI PIU '; text += '

'; text += '

'; } } text += '

'; text += '

'; for (i = 0; i < sliderimg.length; i++) { if (sliderimg[i]['big'] === 0) { text += '

'; text += '

'; text += '

' + sliderimg[i]['titolo'] + '

'; text += 'SCOPRI DI PIU '; text += '

'; text += '

'; } } text += '

'; text += '

'; } if (n_imgs === 6) { // img principale var bwidth = $(window).innerWidth() / 3; var bheight = bwidth * ratio; // console.log(bwidth); // console.log(bheight); for (i = 0; i < sliderimg.length; i++) { text += '

'; text += '

'; text += '

'; text += 'SCOPRI DI PIU '; text += '

'; text += '

'; } } if (n_imgs === 7) { // img principale var bwidth = $(window).innerWidth() * 7 / 12; var bheight = bwidth * ratio; // img secondarie var swidth = bwidth / 3; var sheight = bheight / 3; // console.log(bwidth); // console.log(bheight); // console.log(swidth); // console.log(sheight); for (i = 0; i < sliderimg.length; i++) { if (sliderimg[i]['big'] === 1) { text += '

'; text += '

'; text += '

'; text += 'SCOPRI DI PIU '; text += '

'; text += '

'; } } text += '

'; text += '

'; for (i = 0; i < sliderimg.length; i++) { if (sliderimg[i]['big'] === 0) { text += '

'; text += '

'; text += '

' + sliderimg[i]['titolo'] + '

'; text += 'SCOPRI DI PIU '; text += '

'; text += '

'; } } text += '

'; text += '

'; } text += '

'; return text; } function wuerthitaly_getCookie(cname) { var name = cname + "="; var ca = document.cookie.split(';'); for (var i = 0; i < ca.length; i++) { var c = ca[i]; while (c.charAt(0) == ' ') { c = c.substring(1); } if (c.indexOf(name) == 0) { return c.substring(name.length, c.length); } } return ""; } function wuerthitaly_setCookie(cname, cvalue, exdays) { var d = new Date(); d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000)); var expires = "expires=" + d.toUTCString(); document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/"; } function wuerthitaly_getUrlValue(value) { var current_url = location.pathname; var current_url_split = current_url.split("/"); if (value == 1) { var result = current_url_split[1]; } if (value == 2) { var result = current_url_split[2].split('.cyid'); var result = result[0]; } return result; } function wuerthitaly_findGetParameter(parameterName) { if (window.location.href.indexOf('' + parameterName + '=') > 0) { var result = null, tmp = []; var items = location.search.substr(1).split("&"); for (var index = 0; index < items.length; index++) { tmp = items[index].split("="); if (tmp[0] === parameterName) result = decodeURIComponent(tmp[1]); } return result; } else { return ''; } } function wuerthitaly_isEven(value) { if (value % 2 == 0) return true; else return false; } /* function wuerthitaly_getPrices(productNo, packingUnit, modelNo, packageUnit, elToFill, callBack) { var productNoTmp = productNo; var tmpPriceKeyQuantity = ''; var minPackSize = 0; var urlToCall = '/is-bin/INTERSHOP.enfinity/WFS/3114-B1-Site/it_IT/-/EUR/ViewModelDetail-AjaxGetPrice?Products%5B%5D=' + productNo.replace(/X/g, "%20") + '&SupplierID=WuerthGroup-Wuerth&ModelName=' + modelNo; if (packageUnit == undefined) { packageUnit = 'Pz'; } $.ajax({ method: 'GET', dataType: 'json', url: urlToCall, success: function (data) { if (Object.keys(data).length > 0) { //console.log(data); var prices = data[0].articlePriceVos; if (packingUnit == undefined) { var prevSize = 0; jQuery.each(prices, function (i, obj) { prevSize = parseInt(obj['packingUnit']); if (minPackSize == 0) { minPackSize = prevSize; } if (minPackSize > prevSize) { minPackSize = prevSize; } }); } if (minPackSize > 0) { packingUnit = minPackSize; } jQuery.each(prices, function (i, obj) { if (packingUnit == obj['packingUnit']) { $('.price_' + productNoTmp + '').html(obj['pricePerKey']); if (obj['priceKeyQuantity'] == '1') tmpPriceKeyQuantity = '1'; if (obj['priceKeyQuantity'] == '2') tmpPriceKeyQuantity = '100'; if (obj['priceKeyQuantity'] == '3') tmpPriceKeyQuantity = '1.000'; callBack(obj['pricePerPacking'] + ' x ' + packingUnit + ' ' + packageUnit, elToFill); } }); } } }); return false; } */ async function wuerthitaly_getPrices(pack) { if (pack === "") { return } var urlToCall = '/is-bin/INTERSHOP.enfinity/WFS/3114-B1-Site/it_IT/-/EUR/ViewModelDetail-AjaxGetPrice?' + pack var prices = $.ajax({ method: 'GET', dataType: 'json', url: urlToCall, success: function (data) { if (Object.keys(data).length > 0) { for (const [key, value] of Object.entries(data)) { let element = document.querySelectorAll("[data-sku='" + value['productNo'].replace(/\s/g, 'X') + "'") for (i = 0; i < element.length; i++) { let packingSpecific = value['articlePriceVos'].find(x => x.packingUnit === parseInt(element[i].dataset.modelno, 10)) || value['articlePriceVos'][0] try { if (packingSpecific['pricePerPacking'] === "N/A") { element[i].innerHTML = 'per il prezzo
effettua il login'; element[i].dataset.pricing = "completed"; } else { element[i].innerHTML = packingSpecific['pricePerPacking'] + ' x ' + element[i].dataset.modelno + packingSpecific['quantityUnit']['shortType']; element[i].dataset.pricing = "completed"; } } catch (error) { console.error(error) } } } } } }) } function wuerthitaly_showPrice(price, elToFill) { if (parseFloat(price.replace(' €', '')) > 0) { elToFill.innerHTML = price; } } /* function wuerthitaly_applyPrices() { $('[id^="showprices_"]').each(function (id, el) { artinfo = el.id.split('_'); price = wuerthitaly_getPrices(artinfo[1], artinfo[2], '', artinfo[3], el, wuerthitaly_showPrice); //console.log(artinfo[1], price); if (!price) { el.innerHTML = 'Per il prezzo
effettua login'; } }); } */ async function wuerthitaly_applyPrices(parentContainer = null) { if (!document.querySelector('form[name="ServiceAuthenticationCredentials"] input[name="kunr"]')?.value) return; let articles = (parentContainer !== null ? document.querySelectorAll(parentContainer + ' [id^="showprices_"]') : document.querySelectorAll(' [id^="showprices_"]')) let artInfoReq = ""; let partialIndex = 0 for (let i = 0; i < articles.length; i++) { if (articles[i].dataset.pricing !== "completed" && articles[i].dataset.pricing !== "pending") { artinfo = articles[i].id.split('_'); artInfoReq += 'Products%5B%5D=' + artinfo[1].replace(/X/g, "%20") + '&SupplierID=WuerthGroup-Wuerth&ModelName=' + artinfo[2] + '&'; // console.log('Products%5B%5D=' + artinfo[1].replace(/X/g , "%20") + '&SupplierID=WuerthGroup-Wuerth&ModelName=' + artinfo[2]); articles[i].innerHTML = "" articles[i].dataset.pricing = "pending"; articles[i].dataset.sku = artinfo[1].replace(/\s/g, "X"); articles[i].dataset.modelno = artinfo[2]; } if (i % 30 === 0) { await wuerthitaly_getPrices(artInfoReq) artInfoReq = ""; } else if (i === articles.length - 1) { wuerthitaly_getPrices(artInfoReq) } } } const trackCart = (jsonResponse) => { if(jsonResponse?.cart?.items){ console.log("devtracking") const {items} = jsonResponse?.cart; dataLayer.push({ "event":"addToCart" , items }) } } function wuerthitaly_quickAddProductsToCart(productno, packageunit, packagesize, forceRefresh) { if (productno == undefined) { return false; } /*if (productno.substring(0, 3) == 'id_') { productno = $('#' + productno); }*/ var products = {}; products.supplierId = 'WuerthGroup-Wuerth'; products.articles = new Array(); products.articles.push({ productNo: productno, packingUnit: packageunit, quantity: packagesize }); products = JSON.stringify(products); $.ajax({ url: 'https://eshop.wuerth.it/is-bin/INTERSHOP.enfinity/WFS/3114-B1-Site/it_IT/-/EUR/ViewModelDetail-AjaxAddArticlesToCurrentShoppingCart', dataType: "html", type: "POST", data: { ShoppingCartForm: products }, success: function (F) { applicationFrameMessages.displayMessage(F); let authCred = document.querySelector('form[name="ServiceAuthenticationCredentials"] input[name="kunr"]'); console.log(authCred); trackCart(jsonResponse); updateMiniBasketCounter(jsonResponse.shoppingCartItemsCount); if (forceRefresh == 1) { location.reload(); } return false; } }); return false; } function wuerthitaly_getNavigation(cmp, sections, title, style, company, link_style) { var content = ""; content += '

'; return content; } function wuerthitaly_addNavigationScrollEffect() { // Select all links with hashes $('a[href*="#"]') // Remove links that don't actually link to anything .not('[href="#"]') .not('[href="#0"]') .click(function (event) { var stickyHeight = $('#header_partner').height(); // On-page links if (location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') && location.hostname == this.hostname) { // Figure out element to scroll to var target = $(this.hash); target = target.length ? target : $('[name=' + this.hash.slice(1) + ']'); // Does a scroll target exist? if (target.length) { // Only prevent default if animation is actually gonna happen event.preventDefault(); $('html, body').animate({ scrollTop: target.offset().top - 100 - stickyHeight }, 1000, "easeInCubic", function () { // Callback after animation // Must change focus! var $target = $(target); $target.focus(); if ($target.is(":focus")) { // Checking if the target was focused return false; } else { $target.attr('tabindex', '-1'); // Adding tabindex for elements not focusable $target.focus(); // Set focus again }; }); } } }); } function wuerthitaly_addSectionHeader(section) { var content = ""; if (section['section_settings'][0]['from'] !== '' && section['section_settings'][0]['to'] !== '') { if (wuerthitaly_dateCheck(section['section_settings'][0]['from'], section['section_settings'][0]['to']) == 'current') { if (section['image_settings'][0]['src'] != '') { // immagine if (section['title_settings'][0]['type'] == 1) { if (section['title_settings'][0]['position'] == "top") { content += '

'; content += '

'; content += ''; if (section['title'] != '') { content += section['title']; } else { content += section['name']; } content += ''; content += '

'; content += '

'; } } if (section['image_settings'][0]['parallax'] == 1) { // parallasse content += '

'; content += '

'; // semplice content += '

'; // con ombra if (section['image_settings'][0]['shadow'] != '') { content += ''; } content += '

'; if (section['title_settings'][0]['type'] == 0) { content += '

'; content += ''; if (section['title'] != '') { content += section['title']; } else { if (section['name'] != '') { content += section['name']; } } content += ''; if (section['cta_settings'][0]['string'] != '') { content += '
' + section['cta_settings'][0]['string'] + ''; } content += '

'; } if (section['image_settings'][0]['scroll_incentive'] == 1) { content += '

'; content += '

'; content += '

'; content += '

'; content += '

'; } content += '

'; content += '

'; } else { // no parallasse content += '

'; content += '

'; // semplice content += '

'; // con ombra if (section['image_settings'][0]['shadow'] != '') { content += ''; } content += '

'; if (section['title_settings'][0]['type'] == 0) { content += '

'; content += ''; if (section['title'] != '') { content += section['title']; } else { if (section['name'] != '') { content += section['name']; } } content += ''; if (section['cta_settings'][0]['string'] != '') { content += '
' + section['cta_settings'][0]['string'] + ''; } content += '

'; if (section['image_settings'][0]['scroll_incentive'] == 1) { content += '

'; content += '

'; content += '

'; content += '

'; content += '

'; } } content += '

'; content += '

'; } if (section['title_settings'][0]['type'] == 1) { if (section['title_settings'][0]['position'] == "bottom") { content += '

'; content += '

'; content += ''; if (section['title'] != '') { content += section['title']; } else { content += section['name']; } content += ''; content += '

'; content += '

'; } } } else { // testo content += '

'; content += '

'; content += ''; if (section['title'] != '') { content += section['title']; } else { content += section['name']; } content += ''; content += '

'; content += '

'; } } } return content; } function wuerthitaly_createCompareImage(img_before, text_before, img_after, text_after) { var content = ""; content += '

'; content += 'Gamme di prodotti per professionisti - Würth Italia (22)'; content += '' + text_after + ''; content += '

'; content += 'Gamme di prodotti per professionisti - Würth Italia (23)'; content += '' + text_before + ''; content += '

'; content += ''; content += '

'; return content; } function wuerthitaly_addCompareImageEffect() { var dragging = false, scrolling = false, resizing = false; //cache jQuery objects var imageComparisonContainers = $('.cd-image-container'); //check if the .cd-image-container is in the viewport //if yes, animate it checkPosition(imageComparisonContainers); $(window).on('scroll', function () { if (!scrolling) { scrolling = true; (!window.requestAnimationFrame) ? setTimeout(function () { checkPosition(imageComparisonContainers); }, 100) : requestAnimationFrame(function () { checkPosition(imageComparisonContainers); }); } }); //make the .cd-handle element draggable and modify .cd-resize-img width according to its position imageComparisonContainers.each(function () { var actual = $(this); drags(actual.find('.cd-handle'), actual.find('.cd-resize-img'), actual, actual.find('.cd-image-label[data-type="original"]'), actual.find('.cd-image-label[data-type="modified"]')); }); //upadate images label visibility $(window).on('resize', function () { if (!resizing) { resizing = true; (!window.requestAnimationFrame) ? setTimeout(function () { checkLabel(imageComparisonContainers); }, 100) : requestAnimationFrame(function () { checkLabel(imageComparisonContainers); }); } }); function checkPosition(container) { container.each(function () { var actualContainer = $(this); if ($(window).scrollTop() + $(window).height() * 0.5 > actualContainer.offset().top) { actualContainer.addClass('is-visible'); } }); scrolling = false; } function checkLabel(container) { container.each(function () { var actual = $(this); updateLabel(actual.find('.cd-image-label[data-type="modified"]'), actual.find('.cd-resize-img'), 'left'); updateLabel(actual.find('.cd-image-label[data-type="original"]'), actual.find('.cd-resize-img'), 'right'); }); resizing = false; } //draggable funtionality - credits to http://css-tricks.com/snippets/jquery/draggable-without-jquery-ui/ function drags(dragElement, resizeElement, container, labelContainer, labelResizeElement) { dragElement.on("mousedown vmousedown", function (e) { dragElement.addClass('draggable'); resizeElement.addClass('resizable'); var dragWidth = dragElement.outerWidth(), xPosition = dragElement.offset().left + dragWidth - e.pageX, containerOffset = container.offset().left, containerWidth = container.outerWidth(), minLeft = containerOffset + 10, maxLeft = containerOffset + containerWidth - dragWidth - 10; dragElement.parents().on("mousemove vmousemove", function (e) { if (!dragging) { dragging = true; (!window.requestAnimationFrame) ? setTimeout(function () { animateDraggedHandle(e, xPosition, dragWidth, minLeft, maxLeft, containerOffset, containerWidth, resizeElement, labelContainer, labelResizeElement); }, 100) : requestAnimationFrame(function () { animateDraggedHandle(e, xPosition, dragWidth, minLeft, maxLeft, containerOffset, containerWidth, resizeElement, labelContainer, labelResizeElement); }); } }).on("mouseup vmouseup", function (e) { dragElement.removeClass('draggable'); resizeElement.removeClass('resizable'); }); e.preventDefault(); }).on("mouseup vmouseup", function (e) { dragElement.removeClass('draggable'); resizeElement.removeClass('resizable'); }); } function animateDraggedHandle(e, xPosition, dragWidth, minLeft, maxLeft, containerOffset, containerWidth, resizeElement, labelContainer, labelResizeElement) { var leftValue = e.pageX + xPosition - dragWidth; //constrain the draggable element to move inside his container if (leftValue < minLeft) { leftValue = minLeft; } else if (leftValue > maxLeft) { leftValue = maxLeft; } var widthValue = (leftValue + dragWidth / 2 - containerOffset) * 100 / containerWidth + '%'; $('.draggable').css('left', widthValue).on("mouseup vmouseup", function () { $(this).removeClass('draggable'); resizeElement.removeClass('resizable'); }); $('.resizable').css('width', widthValue); updateLabel(labelResizeElement, resizeElement, 'left'); updateLabel(labelContainer, resizeElement, 'right'); dragging = false; } function updateLabel(label, resizeElement, position) { if (position == 'left') { (label.offset().left + label.outerWidth() < resizeElement.offset().left + resizeElement.outerWidth()) ? label.removeClass('is-hidden') : label.addClass('is-hidden'); } else { (label.offset().left > resizeElement.offset().left + resizeElement.outerWidth()) ? label.removeClass('is-hidden') : label.addClass('is-hidden'); } } } function wuerthitaly_createSectionOrsy(text_color) { if (text_color === undefined) { text_style = 'text-white'; } else { text_style = text_color; } // console.log(text_color + '_' + text_style); var content = ""; content += '

'; content += '

'; content += '

'; content += wuerthitaly_createCompareImage('/is-bin/intershop.static/WFS/WuerthGroup-Wuerth-Site/3114-B1/en_US/KAM/iveco/imgs/example/magazzino-prima.jpg', 'Prima', '/is-bin/intershop.static/WFS/WuerthGroup-Wuerth-Site/3114-B1/en_US/KAM/iveco/imgs/example/magazzino-dopo.jpg', 'Dopo'); content += '

'; content += '

'; content += '

'; content += 'ORSY® SYSTEM è il sistema di scaffalature componibili pensato per magazzini, officine e altri spazi di lavoro, che rende subito disponibili i materiali di maggior consumo, come prodotti chimici, utensili, minuteria metallica. ORSY® SYSTEM consente di riassortire rapidamente gli articoli più utilizzati, favorendo l’ottimizzazione delle scorte e la riduzione degli spazi di stoccaggio.'; content += '

'; content += ''; content += 'CONFIGURA SUBITO IL TUO SISTEMA ORSY® SYSTEM'; content += ''; content += '

'; content += '

'; content += '

'; return content; } function wuerthitaly_createTimeline(items) { var content = ""; var i, j; content += '

'; content += '

'; content += '

    '; for (i = 0; i < items.length; i++) { content += '
  • '; content += ''; content += '

    '; content += '

    '; content += '

    ' + items[i]['title'] + '

    '; content += '

    ' + items[i]['date'] + '

    '; content += '

    '; if (items[i]['cta_to'] != '') { content += '

    '; content += '' + items[i]['cta'] + ''; content += '

    '; } else { content += '

    '; for (j = 0; j < items[i]['allegati'].length; j++) { content += '' + items[i]['allegati'][j]['title'] + ' '; } content += '

    '; } content += '

    '; content += '
  • '; } content += '

'; content += '

'; content += '

'; return content; } function wuerthitaly_addSection(section, kam, i) { var content = ""; if (section['section_settings'][0]['from'] !== '' && section['section_settings'][0]['to'] !== '') { if (wuerthitaly_dateCheck(section['section_settings'][0]['from'], section['section_settings'][0]['to']) == 'current') { content += '

'; content += wuerthitaly_addSectionHeader(section); if (section['items'].length > 0 || section['filters'].length > 0 || section['coupon'].length > 0 || section['content'] != '') { content += '

'; if (section['section_settings'][0]['type'] == 0) { // la sezione contiene prodotti content += '

'; content += '

'; content += '

'; if (section['items'].length > 0) { content += wuerthitaly_visualizzaProdotti(section['items'], 'classic', section['section_settings'][0]['col'], 'my-3 py-3 px-3', 'h-100', 'img-fluid border border-light d-block mb-3', 'd-block font-family-extrabold font-size-175 text-black text-center text-uppercase', 'd-block text-primary font-family-book font-size-150 text-center padding-y-200', 'text-secondary btn btn-info btn-sm btn-block', kam, i); } if (section['filters'].length > 0) { //content += wuerthitaly_visualizzaProdotti(section['filters'], 'filter', section['section_settings'][0]['col'], 'my-3 py-3 px-3', 'h-100', 'img-fluid border border-light d-block mb-3', 'd-block font-family-extrabold font-size-175 text-black text-center text-uppercase', 'd-block text-primary font-family-book font-size-150 text-center padding-y-200', 'text-secondary btn btn-info btn-sm btn-block', kam, i); } content += '

'; content += '

'; content += '

'; } if (section['section_settings'][0]['type'] == 1) { // la sezione contiene circolari content += wuerthitaly_createTimeline(section['items']); } if (section['section_settings'][0]['type'] == 2) { // la sezione contiene cataloghi } if (section['section_settings'][0]['type'] == 3) { // la sezione contiene elementi custom content += section['content']; } if (section['section_settings'][0]['type'] == 4) { // la sezione contiene promozioni } content += '

'; } content += '

'; return content; } } } /* #################################################################### */ /* - UPDATE GENERAL JS 2022 - */ /* #################################################################### */ //SCROLLING SMOOTH + OFFSET /*$(document).on('click', 'a[href^="#"]:not(.filterbtn)', function (event) { //console.log('clicca e faccio l\'animazione'); event.preventDefault(); $('html, body').animate({ scrollTop: $($.attr(this, 'href')).offset().top - 190 }, 1000); });*/ function wuerthitaly_filter_content(array, search, property) { return array.filter(function (e) { return e[property].includes(search); }); } function wuerthitaly_Object2Array(data) { var keys = []; for (var key in data) { if (data.hasOwnProperty(key)) { keys[key] = data[key]; } } return keys; } function addBundleToCart(sku, sez) { var packageunit = $('#nQuantity_' + sku).val(); var packagesize = $('#packingSelect_' + sku + '_' + sez).val(); if (parseInt(packagesize, 10) >= 1) { wuerthitaly_quickAddProductsToCart(sku, packagesize, packageunit, 0); } } function copyCouponCode(couponLabel) { var copyText = document.querySelector(couponLabel).textContent; var textArea = document.createElement("textarea"); textArea.value = copyText; document.body.appendChild(textArea); textArea.select(); document.execCommand("Copy"); textArea.remove(); var tooltips = document.querySelectorAll(couponLabel + '-tooltip'); tooltips.forEach(tooltip => tooltip.innerHTML = 'Coupon copiato!'); } /* ################################ */ /* - BASIC CORE FUNCTIONS PRODUCT - */ /* ################################ */ class WuerthitalyRenderProduct { constructor(carousel, identifier, arraySubCat, isDropMenu, urlToCall) { this.carousel = carousel; this.identifier = identifier; this.arraySubCat = arraySubCat; this.isDropMenu = isDropMenu; this.urlToCall = urlToCall; } //FUNZIONI PER FAR FUNZIONARE PULSANTI DOPPIO FILTRO ############################## showAll(catMain) { //CARD DELLA SEZIONE DI RIFERIMENTO var card = document.getElementsByClassName('cat-' + catMain); //ARRAY SUBBUTTON DELLA CATEGORIA var subButtons = document.getElementsByClassName('subBtn-' + catMain); //PULSANTE MOSTRA TUTTO DELLA SEZIONE DI RIFERIMENTO var showAll = document.getElementById('showall-' + catMain) card.forEach(card => { card.classList.remove('d-none-animated') card.removeAttribute('style') card.classList.add('d-show-animated') }); for (let x = 0; x < subButtons.length; x++) { subButtons[x].classList.remove('selected') } if (!showAll.classList.contains("selected")) { showAll.classList.add("selected"); } } subFilter(catMain, catSub) { console.log("catMain", catMain); console.log("catSub", catSub); //TUTTE LE CARD var card = document.getElementsByClassName('cat-' + catMain); //CLASSE DELLA CARD IDENTIFICATIVA var classeID = ('sub-' + catSub + catMain); // CARD SINGOLA var subCard = document.getElementsByClassName('sub-' + catSub + catMain); console.log(subCard ) //ARRAY SUBBUTTON DELLA CATEGORIA var subCatButtons = document.getElementsByClassName('subBtn-' + catMain); //PULSANTE SUBCATEGORIA PREMUTO DELLA SEZIONE E FILTRO DI RIFERIMENTO var btn = document.getElementById("cat-" + catSub + catMain); //PULSANTE MOSTRA TUTTO DELLA SEZIONE DI RIFERIMENTO var showAll = document.getElementById("showall-" + catMain + "") // CSS PULSANTI ====================== if (showAll.classList.contains("selected")) { showAll.classList.remove("selected"); } for (let z = 0; z < subCatButtons.length; z++) { subCatButtons[z].classList.remove('selected') } if (!btn.classList.contains("selected")) { btn.classList.add("selected"); } // FINE CSS PULSANTI ============================== // FUNZIONI PER LE CARD ====================== //SE LA CARD CONTIENE LE CLASSI DELLA SOTTOCATEGORIA ED HA IL DISPLAY-NONE //LE PRENDE E GLI RIMUOVE IL D-NONE MOSTRANDOLE CON L'ANIMAZIONE card.forEach(card => { if (card.classList.contains(classeID) && card.classList.contains('d-none-animated')) { card.classList.remove('d-none-animated'); card.removeAttribute('style'); card.classList.add('d-show-animated'); } }); //SE INVECE NON CONTIENE LE CLASSI DELLA SOTTTCATEGORIA E NON HA D-NONE //PRENDE LE CARD NON APPARTENENTI AGGIUNTE D-NONE E LE NASCONDE card.forEach(card => { if (!card.classList.contains(classeID) && !card.classList.contains('d-none-animated')) { if (card.classList.contains('d-show-animated')) { card.classList.remove('d-show-animated'); } card.classList.add('d-none-animated'); //DI CONSEGUENZA IL TIMEOUT SOTTO VIENE ESEGUITO } }); setTimeout(() => { document.querySelectorAll(".d-none-animated").forEach(el => el.style.display = 'none'); }, 360); }; /**##################################### * * ## FUNZIONE RENDER SEZIONE PRODOTTI ## * -------------------------------------- * carousel = se essere un carosello(true) o una griglia(false) * identifier = è un array di length 3 di testo * arraySubCat = Array di testo con i nomi delle categorie * isDropMenu = se (true) appaiono le categorie sottoforma di dropdown menu * se (false) appaiono dei pulsanti da premere * theme = dark o light * urlToCall = url per la chiamata * ##################################### */ print(carousel, identifier, arraySubCat, isDropMenu, theme, urlToCall) { var txt_color = "" if (theme == "dark") { txt_color = "black" } else if (theme == "light") { txt_color = "white" } // Categoria della sezione nel file excel = identifier[0] let sezioneProd = identifier[0] // Titolo da mostrare nella categoria let titoloCat = identifier[1] // Descrizione eventuale della categoria let descriptionCat = identifier[2] // CHIAMATA AJAX PER INFO PRODOTTI this.array_setter(urlToCall).then(value => { console.log('Appendproduct', value); this.Appendproduct(value) }) let Product_section = `

${titoloCat}

${descriptionCat}

`; //SE VIENE PASSATO UN ARRAY DI CATEGORIE ALLORA... GENERA L'HTML DEI PULSANTI if (Array.isArray(arraySubCat)) { //Variabile per inserire categoria in minuscolo e con trattino //così da poterle aggiungere come classi o ID nell'HTML var catLower = "" Product_section += '

'; //SE isDropMenu = True - GENERA HTML PER PER IL DROPDOWN if (isDropMenu === true) { Product_section += '

'; Product_section += 'Filtra per:'; Product_section += '

'; Product_section += ''; Product_section += '

'; Product_section += 'Mostra tutto'; arraySubCat.forEach(cat => { console.log("isDropMenu === true", cat); // SISTEMA SINTASSI DELLA CATEGORIA RENDENDOLA MINUSCOLA E GLI SPAZI SOSTITUITI CON UN TRATTINO // IN MODO DA POTERLA INSERIRE COME CLASSE/ID NEI PULSANTI var catLower = cat.toLowerCase(); catLower = catLower.replace(/\s/g, '-'); catLower = catLower.replace(/[()]/g, ''); // SISTEMA SINTASSI PER INSERIRE IL TESTO DENTRO IL PULSANTE // TOGLIENDO I TRATTINI SE PRESENTI var catFix = cat catFix = catFix.replace(/-/g, ' ') // PULSANTE CATEGORIA - SUB BUTTON Product_section += '' + catFix + '' }); Product_section += '

'; Product_section += '

'; Product_section += '

'; //SE isDropMenu = False - GENERA HTML CON PULSANTI } else if (isDropMenu === false) { Product_section += 'Filtra per: '; Product_section += 'Filtra per: '; Product_section += 'Mostra tutto'; arraySubCat.forEach(cat => { console.log("isDropMenu === false", cat); //SISTEMA SINTASSI DELLA CATEGORIA RENDENDOLA MINUSCOLA E GLI SPAZI SOSTITUITI CON UN TRATTINO //IN MODO DA POTERLA INSERIRE COME CLASSE/ID NEI PULSANTI var catLower = cat.toLowerCase() catLower = catLower.replace(/\s/g, '-') catLower = catLower.replace(/[()]/g, ''); // SISTEMA SINTASSI PER INSERIRE IL TESTO DENTRO IL PULSANTE // TOGLIENDO I TRATTINI SE PRESENTI var catFix = cat catFix = catFix.replace(/-/g, ' ') console.log('' + catFix + ''); //SUB BUTTON Product_section += '' + catFix + '' }); } Product_section += `

` } Product_section += `

`; //DIV CAROSELLO - QUI L'ALTRA FUNZIONE APPENDE LE CARD PRODOTTO Product_section += `

` return Product_section; //return document.getElementById("productHeader").innerHTML = Product_section } /** * # ENG # * Function for adding quantity packages to the cart * (Automatically managed function used within the "productOutputter" function) * * # ITA # * Funzione per aggiunta al carrello dei pacchetti di quantità * (Funzione a gestione automatica utilizzata all'interno della funzione "productOutputter") * * @param { string } sku - Product code * @param { string } sez - Section name */ addBundleToCartUpdated(sku, sez) { var packageunit = $('#nQuantity_' + sku).val(); var packagesize = $('#packingSelect_' + sku + '_' + sez).val(); if (parseInt(packagesize, 10) >= 1) { wuerthitaly_quickAddProductsToCart(sku, packagesize, packageunit, 0); } } /** * # ENG # * Function with AJAX call and setting of the final and filtered array, to take the products. * (REMEMBER TO SET "url" ON THE PAGE, WITH THE CALL URL, USING THE "urlToCall" VARIABLE) * * # ITA # * Funzione con chiamata AJAX e settaggio dell'array finale e filtrato, per prendere i prodotti. * ( RICORDARSI DI SETTARE "url" IN PAGINA, CON L'URL DELLA CHIAMATA, TRAMITE LA VARIABILE "urlToCall") * */ async array_setter(urlToCall) { return new Promise((resolve, reject) => { //var urlToCall = 'https://wos.wuerth.it/landing_page_admin/public/page/3204/json'; let filter = []; var products4slider = {}; //console.log("SETTER" + urlToCall); $.ajax({ dataType: 'jsonp', url: urlToCall, success: function (data, status, jxqhr) { //console.log("QUI ORA CE IL DATA"); //console.log(data); let lpArray = []; var items = wuerthitaly_Object2Array(data.items); for (var i = 0; i < items.length; i++) { lpArray[i] = wuerthitaly_Object2Array(items[i]); } lpArray.forEach(prodotto => { var categoria = prodotto['filter_slug'] if (!filter.includes(categoria) && !categoria.includes(',')) { filter.push(categoria) } }); filter.forEach(element => { products4slider[element] = wuerthitaly_filter_content(lpArray, element, 'filter_slug'); }); }, error: function (error) { reject(error) }, complete: function () { resolve(products4slider); wuerthitaly_applyPrices(); } }) }) } /** * # ENG # * Function to hang the single product sheet on the container / product section (generated in another function) * (Automatically managed function used within the "arraySetter" function) * * # ITA # * Funzione per appendere la singola scheda prodotto al container/sezione dei prodotti (generata in un'altra funzione) * (Funzione a gestione automatica utilizzata all'interno della funzione "arraySetter") * * @param { array } Array - Product array * */ Appendproduct(Array) { let temp = ''; for (const [key, value] of Object.entries(Array)) { console.log(key, value); value.forEach(element => { //console.log(element) temp += this.ProductOutputter(element) }); let container = $('#' + key); if (container.length > 0) { container.children('.row')[0].innerHTML = temp; } container.children('.slick_me').slick({ infinite: true, dots: true, speed: 300, slidesToShow: 4, slidesToScroll: 2, responsive: [{ breakpoint: 1400, settings: { slidesToShow: 3, slidesToScroll: 2, infinite: true, arrows: false } }, { breakpoint: 600, settings: { slidesToShow: 2, slidesToScroll: 2, arrows: false } }, { breakpoint: 480, settings: { slidesToShow: 1, slidesToScroll: 1, arrows: false } }] }); } } //Utilizzare nell'excel la colonna "certificazioni" per inserire automaticamente i badge diversificati per ogni prodotto //Modificare la classe .labelbadge_product per personalizzare il badge /** * # ENG # * Main function that generates the final card (HTML) with all the data of the single product. * Use the "certificazioni" column in the Excel to automatically insert different badges for each product * * # ITA # * Funzione principale che genera la card finale (HTML) con tutti i dati del prodotto singolo. * Utilizzare nell'excel la colonna "certificazioni" per inserire automaticamente i badge diversificati per ogni prodotto * * @param { array } singleproduct - Single product object generated by the "Appendproduct" function * */ ProductOutputter(singleproduct) { let text = ""; var nomesezione = singleproduct['filter_slug']; var productUrl = singleproduct['url']; /* VECCHIO METODO CON URL CORTO */ /* var productUrl = singleproduct['type'] == "0" ? productUrl = 'https://eshop.wuerth.it/-/' + singleproduct['sku'] + '.sku/it/IT/EUR/' : productUrl = 'https://eshop.wuerth.it/-/-/' + singleproduct['family'] + '.cyid/3114.cgid/it/IT/EUR/'; */ if (!singleproduct['img'].includes('.jpg')) { singleproduct['img'] = "/is-bin/intershop.static/WFS/WuerthGroup-Wuerth-Site/3114-B1/en_US/_products/imgs/product_image.jpg"; } var image = singleproduct['img']; var uniquePkgs = []; var badgeFix = "" var newBadgeFix = "" var productSku = singleproduct['sku'].replace(/\s/g, '') if (singleproduct['certificazioni']) { badgeFix = singleproduct['certificazioni'].toLowerCase(); newBadgeFix = badgeFix.replace(/\s/g, '-'); } else { newBadgeFix = "nessuno" } $.each(singleproduct['packingunit'], function (i, el) { if ($.inArray(el, uniquePkgs) === -1) uniquePkgs.push(el); }); uniquePkgs.sort(); text += '

'; text += '

'; text += '

'; text += ''; text += ''; text += ''; /* if (singleproduct['certificazioni']) { let catArr = badgeFix.split(","); let currentCard = $('#package_' + productSku + '') //console.log(catArr); catArr.forEach(classe => { let newClasse = classe.replace(/\s/, ''); currentCard.addClass("sub-" + newClasse + nomesezione) }); } */ $(document).ready(function () { /* setTimeout(() => { */ if (singleproduct['certificazioni']) { let catArr = badgeFix.split(","); let currentCard = $('#package_' + productSku + '') //console.log(catArr); catArr.forEach(classe => { let newClasse = classe.replace(/\s/, ''); currentCard.addClass("sub-" + newClasse + nomesezione) }); } /* }, 2500); */ }) text += '

'; if (singleproduct['type'] == 0) { text += ''; if ($('#shopCustomerNo').length) { text += '

'; for (var p = 0; p < uniquePkgs.length; p++) { if (p == 0) { text += ' '; } else { text += ' '; } } text += '

'; } else { text += 'Per il prezzo
effettua il login
'; } text += ''; } if (singleproduct['type'] == 1) { text += ''; } text += ''; text += '' + singleproduct['name'] + ''; text += ''; text += '

' + singleproduct['description'] + '

'; text += '

'; if (singleproduct['type'] == 0) { text += '

'; } else { text += '

'; } if (singleproduct['type'] == 0) { text += '

'; text += '

'; text += '

'; text += ''; text += ''; text += ''; text += '

'; text += '

'; text += '

'; if (uniquePkgs.length <= 1) { text += '

' + uniquePkgs + ' pz.

'; text += ''; } else { text += '

'; text += ''; text += '

'; } text += '

'; text += '

'; } else { text += '

'; text += '

'; } if (singleproduct['type'] == 0) { text += '

'; text += '

'; text += '

'; text += 'NEL CARRELLO '; text += '

'; text += '

'; text += '

'; } else { text += '

'; text += '

'; text += '

'; text += 'VAI ALLE VERSIONI'; text += '

'; text += '

'; text += '

'; } text += '

'; text += '

'; text += '

'; text += '

'; return text; } } const RenderProduct = new WuerthitalyRenderProduct() function autoColumns(elementi_totali, elemento) { // se % 3 === 0 allora tutti al 33% ( 6, 3 ) // se % 2 === 0 allora tutti al 50% ( 4, 2 ) // se > 3 una riga al 33% ( 5 ) // altrimenti uno al 100% ( 1 ) if (elementi_totali % 3 === 0) { return "4"; } if (elementi_totali % 2 === 0) { return "6"; } if (elementi_totali === 5) { if (elemento < 3) { return "4"; } else { return "6"; } } return "12"; } // function sticky_relocate() { // var window_top = $(window).scrollTop(); // // elemento di stop // var footer_top = $("#stopScrollMenu").offset().top; // // posizione dell'ancora // var div_top = $('.aside-anchor').offset().top; // // altezza del contenitore // var div_height_left = $('#filterContentLg').height(); // var padding = 0; // tweak here or get from margins etc // if ((window_top + div_height_left > footer_top - padding - 100)) { // //$('#filterContentLg').css({top: ((window_top + div_height_left - footer_top + padding)*-1)}) // $('#filterContentLg').removeClass('stick'); // $('#filterContentLg').addClass('fixed-stick'); // $('.floatingHelper').removeClass('stick'); // $('.floatingHelper').addClass('fixed-stick'); // } else if (window_top > div_top) { // $('#filterContentLg').addClass('stick'); // $('#filterContentLg').removeClass('fixed-stick'); // $('#filterContentLg').removeClass('anchor-top-0'); // $('.floatingHelper').addClass('stick') // .removeClass('fixed-stick') // .removeClass('anchor-top-0'); // //$('#filterContentLg').css({top: 85}) // } else { // $('#filterContentLg').removeClass('stick'); // if ($('#filterContentLg').hasClass('anchor-top-0')) { // } else { // $('#filterContentLg').addClass('anchor-top-0'); // } // //$('#filterContentLg').css({top: 0}) // $('.floatingHelper').removeClass('stick'); // if ($('.floatingHelper').hasClass('anchor-top-0')) { // } else { // $('.floatingHelper').addClass('anchor-top-0'); // } // } // $('#filterContentLg').css({ 'width': document.getElementById("filterContentLg").offsetWidth + 'px' }); // } $(document).ready(function () { wuerthitaly_applyPrices(); // Move servicemenu up setTimeout(() => { var headerHeight = document.querySelector(".header-new").offsetHeight; document.getElementById("servicemenu").style.top = headerHeight + "px"; }, 2000); }); // ]]>

Ordine minimo ${product.range} €

Codice copiato!

`; } else { contentCopyCoupon = ` Usa il CODICE${ product.stars ? product.stars : "*" }

${product.coupon}

`; } let CouponModal = `

COME USARE IL CODICE

Fai il login all'Online-Shop con le tue credenziali, vai nella pagina del Carrello e scendi fino alla dicitura "Il mio codice promozionale". Inserisci il codice e clicca su "Usa il codice". Assicurati che il codice sia stato accettato, che le condizioni siano state rispettate e procedi con l'ordine.

Gamme di prodotti per professionisti - Würth Italia (25)

`; if ($("#render_utils #infoCodiceCouponModal").length > 0) { } else { $("#render_utils").append(CouponModal); } return contentCopyCoupon; } } const WRenderCopyCoupon = new WuerthitalyRenderCopyCoupon(); /** * * @param { Object[] } sizes * @param { Object[] } coupons (range, coupon, name, img, legal, extra) * @param { string } sizeCoupon - Dimensione coupon (S, M, L) * @param { string } versionCoupon - Versione vecchia o nuova del coupon, default nuova (new, old) * @param { string } theme - Tema (light, dark, white) * @returns { string } contentBoxSizes - HTML Box Taglie */ class WuerthitalyRenderBoxSizes { constructor( sizes, coupons, sizeCoupon = "M", versionCoupon = "new", theme = "dark", ) { this.sizes = sizes; this.coupons = coupons; this.sizeCoupon = sizeCoupon; this.versionCoupon = versionCoupon; this.theme = theme; } boxSizes(sizes, coupons, sizeCoupon, versionCoupon, theme) { theme = theme.toLowerCase(); versionCoupon = versionCoupon.toLowerCase(); let coupon_init = sizes[0][1]; let coupon_id = coupon_init; console.log(coupon_init); /*if (coupon_init.includes('-')) { let coupon_splitted = coupon_init.split('-') coupon_splitted.pop() console.log(coupon_splitted); coupon_id = coupon_splitted.join(""); console.log(coupon_id); } else { coupon_id = coupon_init; console.log(coupon_id); }*/ let contentBoxSizes = ""; contentBoxSizes += `

Seleziona taglia:

`; sizes.forEach((size, i) => { contentBoxSizes += `${size[0]}`; }); contentBoxSizes += `

`; contentBoxSizes += WRenderCopyCoupon.copyCoupon( coupons[0], sizeCoupon, versionCoupon, theme, ); contentBoxSizes += `

`; return contentBoxSizes; } } const WRenderBoxSizes = new WuerthitalyRenderBoxSizes(); /** * * @param { Object[] } buttons [title, link, class, icon] * @param { string } theme (light, dark, white, black) * @param { string } title * @param { string } type (buttons, list, dropdown) * @returns { string } contentHorizontalMenu - HTML Horizontal Menu */ class WuerthitalyRenderHorizontalMenu { constructor(buttons, theme = "light", title = null, type = "list") { this.buttons = buttons; this.theme = theme; this.title = title; this.type = type; } horizontalMenu(buttons, theme, title, type) { let contentHorizontalMenu = ""; let classType = ""; let textColor = ""; let bgColor = ""; theme = theme.toLowerCase(); type = type.toLowerCase(); if (type === "buttons") { classType = "btn btn-sm font-family-bold my-4 mx-2"; } else if (type === "dropdown") { classType = ""; } else { classType = "stikymenu-item position-relative font-family-bold margin-y-200 line-height-200 line-height-xl-250 font-size-200 padding-x-200 text-center text-uppercase"; } if (theme == "black" || theme == "dark") { textColor = "text-white"; bgColor = "bg-dark"; } else { textColor = "text-black"; bgColor = "bg-light"; } contentHorizontalMenu += `

`; if (type === "list") { contentHorizontalMenu += `

`; if (title) { contentHorizontalMenu += ` ${title} `; } buttons.forEach((button) => { contentHorizontalMenu += ` ${button.label} `; }); } else if (type === "buttons") { contentHorizontalMenu += `

`; if (title) { contentHorizontalMenu += ` ${title}

`; } buttons.forEach((button) => { contentHorizontalMenu += ` ${button.label}`; if (button.icon) { contentHorizontalMenu += ``; } contentHorizontalMenu += ``; }); contentHorizontalMenu += `

`; } contentHorizontalMenu += `

${title}

`; buttons.forEach((button) => { contentHorizontalMenu += ` ${button.label} `; }); contentHorizontalMenu += `

`; return contentHorizontalMenu; } } const WRenderHorizontalMenu = new WuerthitalyRenderHorizontalMenu(); /** * Render del BoxApp * * @param { string } version - Version of the component (0,1) * 0 = Complete version * 1 = Small version * */ // TODO: Aggiungere ai param anche h1 e h2 (contenuto banner) class WuerthitalyRenderBoxApp { constructor(version, title, subtitle) { this.version = version; this.title = title; this.subtitle = subtitle; } boxApp(version, title, subtitle) { var text = ""; var buttonHREF = ""; var buttonHTML = ""; if (navigator.userAgent.match(/Android/i)) { buttonHREF = "https://play.google.com/store/apps/details?id=com.sic.android.wuerth.wuerthapp&hl=it"; buttonHTML = "Scarica l'app "; } else if ( navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/iPod/i) || navigator.userAgent.match(/iPad/i) ) { buttonHREF = "https://apps.apple.com/it/app/würth/id391713517"; buttonHTML = "Scarica l'App"; } else { buttonHREF = "https://www.wuerth.it/app/"; buttonHTML = "Scopri la Würth app sul sito dedicato"; } if (version == 0) { if (!title) { title = "Il modo più semplice per ordinare online anche quando sei fuori sede!"; } if (!subtitle) { subtitle = "Promozioni, prodotti, documenti e tanto altro"; } text = `

Gamme di prodotti per professionisti - Würth Italia (26)

${title}

${subtitle}

${buttonHTML}

Gamme di prodotti per professionisti - Würth Italia (27) Gamme di prodotti per professionisti - Würth Italia (28) Gamme di prodotti per professionisti - Würth Italia (29)

`; } else if (version == 1) { if (!title) { title = "Puoi approfittare della promozione anche sulla Würth App."; } if (!subtitle) { subtitle = "Scaricala gratuitamente!"; } text = `

Gamme di prodotti per professionisti - Würth Italia (30)

${title}

${subtitle}

${buttonHTML}

`; } else { console.error( "Render error You entered a non-existing 'version' in the function.", ); console.error("Possible value:"); console.error("0 = Single button version (full-width)"); console.error("1 = Double buttons version (Boxed)"); } return text; } } const WRenderBoxApp = new WuerthitalyRenderBoxApp(); /** * Render di CTA / Pulsanti generici * * @param { string } version - Tipologia di pulsante (primary, secondary, light, dark, outline-primary, outline-secondary, outline-light, outline-dark, link) * @param {string} anchor - Link del pulsante (ancora oppure link esterno) * @param {string} content - Testo pulsante * @param {string} size - Dimensione pulsante (small, large, standard) * @param {string} icon - Classe icona (vedi https://3114-pxe.wgn.wuerth.com/iconset/iconset.cyid/iconset.cgid/it/IT/EUR/) * @param {boolean} block - Button block, or not * */ class WuerthitalyRenderCta { constructor(version, callback, content, size, icon, block, id, target) { this.version = version; this.callback = callback; this.content = content; this.size = size; this.icon = icon; this.block = block; this.id = id; this.target = target; } cta( version, callback = "#", content, size = null, icon = null, block = false, id = null, target = "_self", ) { var text = ""; var sizeClass = ""; var blockClass = ""; var btnClass = ""; var idContent = ""; version = version.toLowerCase(); // Check size if (/(small)/i.test(size)) { sizeClass = "btn-sm px-4 py-3 font-size-175 line-height-050"; } else if (/(large)/i.test(size)) { sizeClass = "btn-lg px-5 font-size-250"; } else { sizeClass = "px-4 font-size-225"; } // Check if button block if (block) { blockClass = "btn-block"; } // Check version if (version == "primary") { btnClass = "btn-primary text-white"; } else if (version == "secondary") { btnClass = "btn-info text-white"; } else if (version == "light") { btnClass = "btn-light"; } else if (version == "dark") { btnClass = "btn-carbon text-white"; } else if (version == "outline-primary") { btnClass = "btn-outline-primary"; } else if (version == "outline-secondary") { btnClass = "btn-outline-info"; } else if (version == "outline-light") { btnClass = "btn-outline-light"; } else if (version == "outline-dark") { btnClass = "btn-outline-carbon"; } else if (version == "link") { btnClass = ""; } else { console.error( "Render error You entered a non-existing 'version' in the function.", ); console.error("Possible value:"); console.error( "primary, secondary, light, dark, outline-primary, outline-secondary, outline-light, outline-dark, link", ); } // Check if ID if (id != null) { idContent = 'id= "' + id + '"'; } // Check typeof callback if (typeof callback == "string") { text += "'; } else { text += "'; } text += content; if (icon) { text += ''; } text += ""; return text; } } const WRenderCta = new WuerthitalyRenderCta(); /** * Render accordion per FAQ * * @param { Object[] } questions - Array with questions and answers [title, content, collapsed] * @param { number } id - Insert a ID for differents accordion * @param { string } version - Versions: light or dark * @param { boolean } multi - Multiple collapse elements * */ class WuerthitalyRenderAccordion { constructor(questions, id = null, version = "light", multi = false) { this.questions = questions; this.id = id; this.version = version; this.multi = multi; } accordion(questions, id, version, multi) { var text = ""; version = version.toLowerCase(); // IF array IS AN ARRAY, PRINT COMPONENT, ELSE PRINT ERROR if (Array.isArray(questions)) { var textColor = ""; var bgColor = ""; if (version === "light") { textColor = "black"; bgColor = "white"; } else { textColor = "white"; bgColor = "black"; } text += `

`; questions.forEach((question, i) => { text += `

`; if (multi) { text += `

`; } else { text += `

`; } text += `

${question[1]}

`; }); text += `

`; } else { console.error("Render error - You entered a non-array variable"); } return text; } } const WRenderAccordion = new WuerthitalyRenderAccordion(); /** * Render category grid / Sezioni a griglia * * @param { Object[] } gridTiles - [img, title, cta, description] * img - Url background * title - Title for category * cta - Link for click * description * */ class WuerthitalyRenderCategoryGrid { constructor(gridTiles) { this.gridTiles = gridTiles; } categoryGrid(gridTiles) { var text = ""; text += `

`; gridTiles.forEach(function (el, key) { text += `

${ el["title"] }

`; }); text += `

`; return text; } } const WRenderCategoryGrid = new WuerthitalyRenderCategoryGrid(); /** * Render category grid / Sezioni a griglia * * @param { Object[] } gridTiles - [img, title, cta, description] * @param { boolean } truncate - Truncate description * */ class WuerthitalyRenderCategoryGridText { constructor(gridTiles, truncate = false, colspan) { this.gridTiles = gridTiles; this.truncate = truncate; this.colspan = colspan; } categoryGrid(gridTiles, truncate, colspan) { let truncateClass = ""; if (truncate) { truncateClass = "w-text-truncate"; } var text = ""; text += `

`; gridTiles.forEach(function (el, key) { if (!el["filter"]) { el["filter"] = ""; } let filterClass = ""; if (Array.isArray(el["filter"])) { filterClass = `filter-all ${el["filter"].map((filter) => `filter-${filter}`).join(" ")}`; } else { filterClass = `filter-all filter-${el["filter"]}`; } text += `

${el["title"]}

${ el["description"] }

Scopri di più

`; }); text += `

`; return text; } } const WRenderCategoryGridText = new WuerthitalyRenderCategoryGridText(); /** * Render menù verticale * * @param { Object[] } items - Elenco delle voci di menu (label, href) * @param { string } title - Titolo del menu * @param { string } content - Contenuto del menu * @param { Object } btn - Contenuto della CTA (testo, link) * * @returns { string } text */ class WuerthitalyRenderVerticalMenu { constructor(theme, items, title = null, content = null, btn) { this.items = items; this.title = title; this.content = content; this.btn = btn; this.theme = theme; } verticalMenu(theme = "light", items, title, content, btn) { var text = ""; var themeClass = ""; var textColor = ""; theme = theme.toLowerCase(); if (theme == "light") { themeClass = "bg-white"; textColor = "text-black"; } else if (theme == "dark") { themeClass = "bg-dark-v-menu"; textColor = "text-white"; } text += `

${title}

`; items.forEach(function (item, key) { text += ``; if (item["icon"]) { text += ``; } text += `${item["label"]} `; }); if (content != null && btn != null) { text += `

${content}

${btn["text"]} `; } text += `

`; return text; } } const WRenderVerticalMenu = new WuerthitalyRenderVerticalMenu(); /** * Render section newsletter * * @param { string } version - Versions: classic (add custom string if you want add new version) * @param { Object[] } content - Array with questions and answers [title, content, image, button] * */ class WuerthitalyRenderNewsletter { constructor(version = "classic", content) { this.version = version; this.content = content; } print(version, content) { var text = ""; version = version.toLowerCase(); // IF VERSION DOESN'T EXIST, PRINT ERROR if (version == "classic") { text += `

Grazie mille,

ti abbiamo appena inviato un'email per confermare il tuo indirizzo: visualizzerai subito la pagina con il tuo sconto!

Dove trovare il tuo codice cliente

Sei già cliente Würth?

Il Codice Cliente è un codice univoco di 9 cifre sempre visibile in fattura (Es. 51XXXXXXX).

Gamme di prodotti per professionisti - Würth Italia (31)

Come recupero il codice cliente?

Chiama il Servizio Clienti al 0471 828000 o scrivici su Whatsapp al 338 7882551 dal Lunedì al Venerdì dalle 8 alle 19 oppure scrivici una e-mail a servizioclienti@wuerth.it

NON SEI UN CLIENTE WÜRTH

Per avere subito il tuo Codice Cliente

Registrati all’Online-Shop!

REGISTRATI

`; function sendSelfMailRegData(customerId, email) { console.log("send newsletter registration request"); var serverURL = "https://www.wuerth.it/php-scripts/eShop/mlregistrations/indexv2.php"; var params = "?&op=saverequest&jsonp=true&clientnumber=" + customerId + "&email=" + encodeURIComponent(email); $.ajax({ url: serverURL + params + "&callback=?", type: "GET", dataType: "jsonp", success: () => { var div_thankyou = document.getElementById("thank_div"); document.getElementById("formnews_div").classList.add("d-none"); div_thankyou.classList.remove("d-none"); }, }); } $(document).ready(function () { var errMsg = document.getElementById("errMsg"); var errForm = document.getElementById("errForm"); var mail = document.getElementById("emailToSendNL"); var code = document.getElementById("clientenumberNL"); function controllForm() { var privacyCheck = document.getElementById("privacyNL"); if (privacyCheck.checked == true) { if (mail.value == "") { errForm.classList.remove("d-none"); errForm.classList.add("d-flex"); errMsg.innerHTML = "Il campo e-mail non può essere vuoto."; } else if (!mail.value.includes("@")) { errForm.classList.remove("d-none"); errForm.classList.add("d-flex"); errMsg.innerHTML = "Devi inserire una e-mail valida."; } else { if (code.value == "") { errForm.classList.remove("d-none"); errForm.classList.add("d-flex"); errMsg.innerHTML = "Il campo codice clienete non può essere vuoto."; } else if (code.value.length > 9 || code.value.length < 9) { errForm.classList.remove("d-none"); errForm.classList.add("d-flex"); errMsg.innerHTML = "Hai inserito un codice cliente non valido"; } else { errForm.classList.remove("d-flex"); errForm.classList.add("d-none"); var emailToSend = document.getElementById("emailToSendNL").value; var codeToSend = document.getElementById("clientenumberNL").value; sendSelfMailRegData(codeToSend, emailToSend); } } } else { errForm.classList.remove("d-none"); errForm.classList.add("d-flex"); errMsg.innerHTML = "Devi accettare i termini per poter proseguire."; } } document .getElementById("form_newsletter_new") .addEventListener("submit", function (event) { // Prevent the form from submitting event.preventDefault(); controllForm(); }); }); } else { console.error("Render error - You entered non valid version"); } return text; } } const WRenderNewsletter = new WuerthitalyRenderNewsletter(); class promoProduct { constructor({ whereToAppend, promoTrackingId, customId = false, productJson = false, productJsonUrl = false, insertTitle = true } = {}) { this.productJson = productJson; this.productJsonUrl = productJsonUrl; this.filter = {}; this.customerID = document.querySelector(`input[name="kunr"]`)?.value; this.title = insertTitle ? `

Inizia i tuoi acquisti da qui

` : `` this.filterSliderSettings = { arrows: false, slidesToShow: 4, slidesToScroll: 4, infinite: false, variableWidth: true, }; this.sliderSettings = { infinite: false, slidesToShow: 4, slidesToScroll: 4, responsive: [ { breakpoint: 1440, settings: { slidesToShow: 4, }, }, { breakpoint: 1200, settings: { slidesToShow: 3, }, }, { breakpoint: 758, settings: { slidesToShow: 2, slidesToScroll: 1, }, }, { breakpoint: 400, settings: { slidesToShow: 1, slidesToScroll: 1, }, }, ], }; this.productWrapperID = customId ? `${customId}-product-wrapper` : `promo-product-wrapper`; this.productWrapper = `

`; this.filterWrapperID = customId ? `${customID}-filter-wrapper` : `promo-filter-wrapper`; this.filterWrapper = `

`; this.productContainer = document.getElementById(whereToAppend) || false; this.promoID = promoTrackingId; this.promoUrl = `https://www.wuerth.it/php-scripts/eShop/product-suggestion/?op=c&customerno=${this.customerID}&cid=RECO_PROMO`; this.initializeSlider = () => { $(`#${this.productWrapperID}`).slick(this.sliderSettings); }; this.init(); } getTheUrl() { if (typeof this.productJsonUrl === "string") { return this.productJsonUrl; } else { return this.promoUrl; } } init() { if (!this.productJson) { const url = this.getTheUrl(); this.getPromoProducts(url).then((e) => { this.renderProducts(e); this.productContainer.innerHTML = this.title + this.filterWrapper + this.productWrapper; this.populatefilter(); document.getElementById(this.productWrapperID).innerHTML = this.createOutputHTML(this.productHTML); this.initializeSlider(); wuerthitaly_applyPrices() }); } else { this.renderProducts(data); this.productContainer.innerHTML = this.filterWrapper + this.productWrapper; this.populatefilter(); document.getElementById(this.productWrapperID).innerHTML = this.createOutputHTML(this.productHTML); this.initializeSlider(); } } logError(message) { console.error("Error: " + message); } renderProducts(e) { if (!this.productContainer) { return console.error(`Product container not found`); } this.products = e; this.productHTML = this.products.map((e) => { const { DSC_PRODUCT: sku, IMAGEBIGURL: imgBig, IMAGETHUMBNAILURL: imgSmall, DESCRIPTION: descr, LEVEL1ID: l1id, LEVEL1: l1name, LONGDESCRIPTION: name, PACKAGE_SIZE: packagesize, PRODUCT_RANK: rank, WIDGET_NAME: widgetName, } = e; if (!this.filter.l1id) { this.filter[l1id] = l1name; } const img = imgBig ? imgSmall : imgBig; const tracking = `${widgetName}_PROMO|${this.promoID}_${sku}_${rank}`; return this.promoproductTemplate( sku, packagesize, img, name, descr, `https://eshop.wuerth.it/-/${sku}.sku/it/IT/EUR/#CampaignName=${tracking}`, l1id, tracking, ); }); } populatefilter() { const filterTemplate = ( level1id, level1name, checked = "", ) => `

${level1name}

`; this.productContainer.classList.add("overflow-hidden"); let filtersHTML = filterTemplate(`all`, `Tutti i Prodotti`, `checked`); for (const [key, value] of Object.entries(this.filter)) { filtersHTML += filterTemplate(key, value); } const filtersWrapper = document.getElementById(this.filterWrapperID); filtersWrapper.innerHTML = filtersHTML; $(filtersWrapper).slick(this.filterSliderSettings); } createOutputHTML(array) { let outputHTML = ""; array.forEach((e) => { outputHTML += e; }); return outputHTML; } promoproductTemplate = ( sku, packagesize, img, name, description, url, level1d, tracking ) => { const filterClass = `filter-promo-${level1d}`; return `

${name} ${description} -,--€

`; }; getPromoProducts(urlToCall) { return new Promise((resolve, reject) => { $.ajax({ url: urlToCall, type: "GET", dataType: "jsonp", success: (e) => resolve(e), error: (e) => reject(e), }); }); } } const handlePromoFilter = (sliderID, button) => { const classFilter = button.value; $(`#${sliderID}`).slick("slickUnfilter"); $(`#${sliderID}`).slick("slickFilter", `.${classFilter}`); }; const newLayoutAddToCart = (button) => { const {productsku: sku, packagesize} = button.dataset; console.log(document.getElementById(`nQuantity_${sku.replace(" ", "")}`)); const packageunit = document.getElementById( `nQuantity_${sku.replace(" ", "")}`, )?.value; wuerthitaly_quickAddProductsToCart(sku, packagesize, packageunit); }; // Giuseppe: Cos'è? function render_products_filter_name(identifier) { let section_name = `${identifier[1]}`; return section_name; } // ]]>

Filtra per:

`; for (var k = 0; k < menu.length; k++) { text += `${menu[k]["title"]}`; } text += `

Gamma

${WRenderCategoryGridText.categoryGrid(gammaTiles, false, 4)}

Lavorazione / situazione

`; filterLavorazioneButtons.forEach((button) => { text += ``; }); text += `

${WRenderCategoryGridText.categoryGrid(lavorazioneSituazioneTiles, false, 4)}

Professionista

${WRenderCategoryGrid.categoryGrid(professionistaTiles)}

`; var component = document.querySelector(cmp); component.innerHTML += text; } function filterContent(btn, section, value) { let toShow = $("#" + section + " " + value); let toHide = $("#" + section + " .filter"); let buttons = document.querySelectorAll(".btn-wfilter"); buttons.forEach((button) => { if (button.classList.contains("btn-primary")) { button.classList.remove("btn-primary"); button.classList.add("btn-dark"); } }); btn.classList.remove("btn-dark"); btn.classList.add("btn-primary"); for (let i = 0; i < toHide.length; i++) { toHide[i].classList.replace("d-block", "d-none"); } for (let i = 0; i < toShow.length; i++) { toShow[i].classList.replace("d-none", "d-block"); } } // function filterContent(btn, section, values) { // let toHide = $("#" + section + " .filter"); // let buttons = document.querySelectorAll(".btn-wfilter"); // buttons.forEach((button) => { // if (button.classList.contains("btn-primary")) { // button.classList.remove("btn-primary"); // button.classList.add("btn-dark"); // } // }); // btn.classList.remove("btn-dark"); // btn.classList.add("btn-primary"); // for (let i = 0; i < toHide.length; i++) { // toHide[i].classList.replace("d-block", "d-none"); // } // if (Array.isArray(values)) { // values.forEach((value) => { // let toShow = $("#" + section + " " + value); // for (let i = 0; i < toShow.length; i++) { // toShow[i].classList.replace("d-none", "d-block"); // } // }); // } else { // let toShow = $("#" + section + " " + values); // for (let i = 0; i < toShow.length; i++) { // toShow[i].classList.replace("d-none", "d-block"); // } // } // } // ]]>

  • Ancoranti Chimici
  • Assy 4
  • Bulloni
  • Carrelli
  • CNC
  • Illuminazione a LED
  • Linea vita
  • M-CUBE®
  • Oleodinamica - WÜFLUID
  • ORSY Mobil
  • Immagazzinamento minuteria
  • Valigette Orsy®
  • Power Tools
  • Siliconi
  • Solar
  • Special Tools
  • Viti Tx
  • Wudomo
  • Pitturare pareti
  • Stuccare pareti
  • Carteggiare pareti
  • Aziende Alimentari
  • Cambio gomme cargo
  • Carpenteria Legno
  • Carrozzeria
  • Gommisti
  • Impermealizzazione
  • Lavori stradali
  • Manutenzione Climatizzatori
  • Manutenzione Climatizzatori auto
  • Mascheratura
  • Moto
  • Prodotti invernali Auto
  • Prodotti invernali Cargo
  • Prodotti invernali edilizia
  • Prodotti invernali Installazioni
  • Pulizia auto
  • Pulizia camion
  • Sostituzione batteria auto
  • Termotecnica
  • Auto
  • Cargo
  • Edilizia
  • Installazioni
  • Legno
  • Metallo
Gamme di prodotti per professionisti - Würth Italia (2025)
Top Articles
Latest Posts
Recommended Articles
Article information

Author: Domingo Moore

Last Updated:

Views: 6188

Rating: 4.2 / 5 (73 voted)

Reviews: 88% of readers found this page helpful

Author information

Name: Domingo Moore

Birthday: 1997-05-20

Address: 6485 Kohler Route, Antonioton, VT 77375-0299

Phone: +3213869077934

Job: Sales Analyst

Hobby: Kayaking, Roller skating, Cabaret, Rugby, Homebrewing, Creative writing, amateur radio

Introduction: My name is Domingo Moore, I am a attractive, gorgeous, funny, jolly, spotless, nice, fantastic person who loves writing and wants to share my knowledge and understanding with you.