Cioccolatino | Flavored Coffee Capsules | Nespresso™ GR
Skip to content
Header
You are on the main content
(function () { /* new casperEventHub.Experience("G0016-SpringPromo_PRO_PR_No_NPlus5FreeSleeves_DNP_LEA__PERSO") .isInDateRange({ start: "2024-04-18", end: "2024-07-31" }) .executeOnMatch(function (data) {*/ var url = window.location.href; const isMachinePLP = /machines/i.test(url); const isCapsPLP = /capsules/i.test(url); const isAccessoriesPLP = /accessories/i.test(url); const body = document.querySelector('body'); let elementCard; let PLP; if (isMachinePLP) { elementCard = 'nb-sku-machine' PLP = 'Machines' body.classList.add('machines-plp') } if (isCapsPLP) { elementCard = '_card_17abg_1' PLP = 'Capsules' body.classList.add('capsules-plp') } if (isAccessoriesPLP) { elementCard = 'nb-sku-accessory' PLP = 'Accessories' body.classList.add('accessories-plp') } var backgroundImage = '/ecom/medias/sys_master/public/33883718352926/YEP-24-OL-promo-PLP-card-EN.jpg'; var isMobile = window.matchMedia("only screen and (max-width: 768px)").matches; if (isMobile){ if (url.indexOf("original") > -1) { backgroundImage ='/ecom/medias/sys_master/public/33883718352926/YEP-24-OL-promo-PLP-card-EN.jpg' }else if (url.indexOf("vertuo") > -1) { backgroundImage = '/ecom/medias/sys_master/public/33883719106590/YEP-24-VL-promo-PLP-card-EN.jpg' } }else{ console.log('desktop') if (url.indexOf("original") > -1) { console.log('original') backgroundImage ='/ecom/medias/sys_master/public/33883718352926/YEP-24-OL-promo-PLP-card-EN.jpg' }else if (url.indexOf("vertuo") > -1) { console.log('vertuo') backgroundImage = '/ecom/medias/sys_master/public/33883719106590/YEP-24-VL-promo-PLP-card-EN.jpg' } } var customPageLoaded = function (selector, callback) { var getElement = function () { return document.querySelectorAll(selector); }; var elementInDomCallback = function () { if (callback && typeof callback === 'function') { setTimeout(callback, 1500); } }; var checkingInterval = null, maxCallTime = 8000, checkElementTime = 450, clearTimeoutInterval = function () { if (checkingInterval) { clearInterval(checkingInterval); } }, waitElement = function () { if (getElement().length) { elementInDomCallback(); clearTimeoutInterval(); } }; checkingInterval = window.setInterval(waitElement, checkElementTime); setTimeout(clearTimeoutInterval, maxCallTime); }; function displayOfferCard(element) { let lang = document.documentElement.lang; let windowWidth = window.innerWidth; if (document.querySelector('.offer-card')) {return}; if (windowWidth < 520) { element = document.querySelector(`plp-cards-grid ._card_17abg_1:last-of-type`) } element.insertAdjacentHTML('afterend', `
`); document.querySelector('.offer-card .img').addEventListener('click', () => { gtmDataObject.push({ event: 'customEvent', eventRaisedBy: 'FreeHTML', eventCategory: 'User Engagement', eventAction: 'Click', eventLabel: `WithinProductsBanner - ${PLP} PLP - Explore Offer`, nonInteraction: '0' }); // document.location.href = '/gr/el/order/accessories/original/aeroccino4'; }) } let innerWidth = window.innerWidth; let ii; if (innerWidth < 1046) { if (PLP == 'Capsules') { ii = 3 } else { ii = 2 } } else if (innerWidth < 840) { if (PLP == 'Capsules') { ii = 2 } else { ii = 1 } } else if (innerWidth < 768) { ii = 1; } else { if (PLP == 'Capsules') { ii = 4 } else { ii = 3 } } customPageLoaded(`plp-cards-grid ._card_17abg_1:nth-of-type(${ii})`, () => { let card = document.querySelector(`plp-cards-grid ._card_17abg_1:nth-of-type(${ii})`); displayOfferCard(card); }); let inspirationCard; window.addEventListener('resize', function (event) { let resizedWidth = window.innerWidth; if (resizedWidth < 768) return; let ii; if (resizedWidth < 1046) { if (PLP == 'Capsules') { ii = 3 } else { ii = 2 } } else if (resizedWidth < 840) { if (PLP == 'Capsules') { ii = 2 } else { ii = 1 } } else if (resizedWidth < 768) { ii = 1; } else { if (PLP == 'Capsules') { ii = 4 } else { ii = 3 } } clearTimeout(inspirationCard); // Select all elements with the class "offer-card" const elementsToDelete = document.querySelectorAll('.offer-card'); if (elementsToDelete) { elementsToDelete.forEach(element => { element.remove(); }); } inspirationCard = setTimeout(function () { customPageLoaded(`plp-cards-grid ._card_17abg_1:nth-of-type(${ii})`, () => { let card = document.querySelector(`plp-cards-grid ._card_17abg_1:nth-of-type(${ii})`); displayOfferCard(card); }); }, 500); }, true); /* data.unsubscribe(); }) .evaluate();*/ })();