var impreseeRegister = document.createElement("script"); impreseeRegister.type = "text/javascript"; impreseeRegister.async = true; impreseeRegister.src = "https://cdn.impresee.com/integrations/impresee_lib.js"; if(impreseeRegister.readyState) { // only required for IE <9 impreseeRegister.onreadystatechange = function() { if ( impreseeRegister.readyState === "loaded" || impreseeRegister.readyState === "complete" ) { impreseeRegister.onreadystatechange = null; impresee(); } }; } else { //Others impreseeRegister.onload = function() { impresee(); }; } var _seeFirst = document.getElementsByTagName("script")[0]; _seeFirst.parentNode.insertBefore(impreseeRegister, _seeFirst); function impreseeRegisterLogin(){ if (!prestashop.customer || !prestashop.customer.email) return; var impreseeUserKey = '_wseeUser'; var currentUser = prestashop.customer.firstname+'-'+prestashop.customer.lastname+'-'+prestashop.customer.email; if (currentUser != localStorage.getItem(impreseeUserKey)){ localStorage.setItem(impreseeUserKey, currentUser); if (prestashop.customer && prestashop.customer.email){ var data = impreseeParseCustomerData(); impreseeSendData([], 'prestashop_1_0', 'LOGIN', window._wssee_store_platform, '', data); } } } function onPressChangeDistribution() { let container = document.querySelector("#ImpreseeTextResultsModalId"); if (container) { let newHeight = container.scrollHeight + 100; const containerInSite = document.querySelector("#main"); if (containerInSite){ containerInSite.style.minHeight = newHeight + "px"; } } } function impreseeCloseModal(){ let modalElement = document.querySelector('#blockcart-modal'); var modalBackdrop = document.querySelector('.modal-backdrop'); if(modalBackdrop) { modalBackdrop.parentElement.removeChild(modalBackdrop); } if(modalElement){ modalElement.parentElement.removeChild(modalElement); } document.body.classList.remove('modal-open'); } function parseProductIdImpresee(productId) { return "PROD-"+productId+"-0"; } function impreseeAddToCart(product) { var formData = ''; formData += 'token=' + encodeURIComponent(prestashop.static_token); formData += '&id_product=' + encodeURIComponent(product.data.parent); formData += '&qty=' + encodeURIComponent("1"); formData += '&add=' + encodeURIComponent("1"); formData += '&action=' + encodeURIComponent("update"); var request = new XMLHttpRequest(); request.onreadystatechange = function() { if (request.readyState == XMLHttpRequest.DONE) { var modalFormData = ''; modalFormData += 'id_customization=0'; modalFormData += '&id_product_attribute=0'; modalFormData += '&id_product=' + encodeURIComponent(product.data.parent); modalFormData += '&action=' + encodeURIComponent("add-to-cart"); var modalRequest = new XMLHttpRequest(); modalRequest.onreadystatechange = function() { if (modalRequest.readyState == XMLHttpRequest.DONE) { var responseJson = JSON.parse(modalRequest.responseText); var modalHTML = responseJson.modal; var modal = new DOMParser().parseFromString(modalHTML, "text/html"); var modalDocument = document.querySelector('#blockcart-modal'); document.body.classList.add('modal-open'); let modalElement = modal.querySelector('#blockcart-modal'); modalElement.classList.add('in'); modalElement.style.display = 'block'; let continueButton = modalElement.querySelector('.cart-content-btn button'); if(continueButton) { continueButton.addEventListener('click', impreseeCloseModal); } let closeButton = modalElement.querySelector('.modal-header .close'); if(closeButton) { closeButton.addEventListener('click', impreseeCloseModal); } if (!modalDocument){ document.body.appendChild(modalElement); } else { modalDocument.innerHTML = modalElement.innerHTML; } var modalBackdrop = document.querySelector('.modal-backdrop'); if (!modalBackdrop){ modalBackdrop = document.createElement('div'); modalBackdrop.classList.add('modal-backdrop'); modalBackdrop.classList.add('fade'); modalBackdrop.classList.add('in'); document.body.appendChild(modalBackdrop); } } }; modalRequest.open("POST", 'https://alishaperfumes.cl/module/ps_shoppingcart/ajax'); modalRequest.setRequestHeader('Content-type', 'application/x-www-form-urlencoded'); modalRequest.setRequestHeader('Accept', '*/*;'); modalRequest.send(modalFormData); } } request.open("POST", prestashop.urls.pages.cart); request.setRequestHeader('Content-type', 'application/x-www-form-urlencoded'); request.setRequestHeader('Accept', 'application/json, text/javascript, */*;'); request.send(formData); } function impreseeParseProductDataIntoUrl(items){ var id = []; var price = []; var quantity = []; var sku = []; for (var key in Array.from(items)){ var item = items[key]; id.push(item.id_product || ''); price.push(item.price || ''); quantity.push(item.quantity); sku.push(item.sku || ''); } // View product data var data = '&pid=' + encodeURIComponent(id.join('|')); data += '&p=' + encodeURIComponent(price.join('|')); data += '&qty=' + encodeURIComponent(quantity.join('|')); data += '&sku=' + encodeURIComponent(sku.join('|')); return data; } function impreseeParseCustomerData(){ var data = ''; // Add customer data if (prestashop.customer && prestashop.customer.email){ data += '&cfn=' + encodeURIComponent(prestashop.customer.firstname || ''); data += '&cln=' + encodeURIComponent(prestashop.customer.lastname || ''); data += '&cem=' + encodeURIComponent(prestashop.customer.email); } return data; } function impreseeSendProductRelatedData(items, eventType, action) { var data = impreseeParseProductDataIntoUrl(items); data += impreseeParseCustomerData(); window.impreseeSendData([], eventType, action, window._wssee_store_platform, '', data); } /** Listener para registrar add to cart */ function wseeRegisterAddToCart(elem){ var button = elem[0]; var buttonContainer = button.parentElement; var data = {}; if (buttonContainer.tagName==="FORM") { //Add to cart general var addToCartDiv = buttonContainer.parentElement; var productDescriptionDiv = addToCartDiv.parentElement; data.id_product = parseProductIdImpresee(buttonContainer.querySelector('input[name=id_product]').getAttribute('value')); data.price = productDescriptionDiv.querySelector('.price-final').getAttribute('content'); data.quantity = buttonContainer.querySelector('input[name=qty]').getAttribute('value'); } else if (buttonContainer.classList[0]==='add') { //Add to cart en ficha de producto var productQuantityDiv = buttonContainer.parentElement; var productAddToCartDiv = productQuantityDiv.parentElement; var productForm = productAddToCartDiv.parentElement; data.id_product = parseProductIdImpresee(productForm.querySelector('input[name=id_product]').getAttribute('value')); data.quantity = productForm.querySelector('input[name=qty]').value; data.price = document.querySelector('meta[property="product:price:amount"]').content; } data.sku = ""; if (window._wssee_store_platform === 'prestashop'){ impreseeSendProductRelatedData([data], 'prestashop_1_0', "ADD_TO_CART"); } } /** Registrar un view product */ function wseeRegisterViewProduct(){ var data = {}; var metaProductId = document.querySelector('meta[property="product:retailer_item_id"]') ? document.querySelector('meta[property="product:retailer_item_id"]').content: ""; data.id_product = parseProductIdImpresee(metaProductId); data.price = document.querySelector('meta[property="product:price:amount"]').content; skuObj = $('span[itemprop=sku]'); sku = skuObj.text(); data.sku = sku; if (window._wssee_store_platform == 'prestashop'){ impreseeSendProductRelatedData([data], 'prestashop_1_0', "VIEW_PRODUCT"); } } function impresee() { window._wssee_store_app_code="d0122d1c-dc32-45cb-97a7-420fe0565ebe"; window._wssee_store_platform="prestashop"; window._wssee_store_url=window.location.origin; $('button.add-to-cart').click(function() { wseeRegisterAddToCart($(this)); }); $( document ).ready(function() { var metaType = document.querySelector('meta[property="og:type"]'); if (metaType && metaType.content === "product"){ wseeRegisterViewProduct(); } }); function impreseeNumberWithPoint(x) { if (!x) return x; return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, '.'); } jQuery('input[name=s]').off(); /** Custom Css */ var _wseeCss = document.createElement('style'); _wseeCss.type = 'text/css'; _wseeCss.innerHTML = '.ImpreseeMobile .ImpreseeSimpleProduct .ImpreseeNormalPrice{text-indent:0!important;text-align:center!important;} .ImpreseeMobile .ImpreseeSimpleProduct .ImpreseeProductPrices .ImpreseePrice{margin-right: 0!important;font-size: 0.7em!important;} {text-indent:0!important;} .ImpreseeGrid .ImpreseeProductLink{padding: 0px!important;}.ImpreseeMobile .ImpreseeGrid .ImpreseeProductLink{padding: 0px 6px!important;} .ImpreseeChangeDisplayFormatContainer{display:none!important;}.ImpreseeProduct {border: none!important;}.ImpreseeProduct .ImpreseeOnSaleSign {border-top-style: none!important;}.ImpreseeOnSaleSign span{border-bottom-right-radius: 0!important;}.impresee-price-label, .ImpreseeTitle {font-weight:400 !important; color:#777 !important; font-size:1em!important;} .ImpreseePrice {color: #cc2c23!important; font-size:0.95em!important;}.ui-autocomplete.ui-front.ui-menu.ui-widget.ui-widget-content.ui-corner-all{display:none!important;} .ImpreseeProduct,.ImpreseeSimpleProduct,.ImpreseeTitle, .ImpreseeTexts, .ImpreseePrice{text-align:center!important;}.impresee-rd-price span{text-decoration: line-through;} .impresee-rd-price {font-size: 0.8em;}.ImpreseeMobile .ImpreseeSimpleProduct .ImpreseeNormalPrice{font-size: 0.7em!important;} .ImpreseeMobile .ImpreseeSimpleProduct .ImpreseeTexts{max-height: 100px!important;} .ImpreseeMobile .ImpreseeSimpleProduct{height: 265px !important;}.ImpreseeSimpleProduct{height: 350px !important;} .ImpreseeDiscountPercentage{bottom: auto!important; right: auto!important;left:10px!important; top: 10px!important; border-radius: 0!important;} .ImpreseeSimpleProduct .ImpreseeDiscountPercentage{bottom: auto!important;}.ImpreseeGrid .ImpreseeTexts {border-top: none!important; padding: 7% 2% !important;padding-bottom: 0% !important; }.ImpreseeOnSaleSign{z-index:9!important;text-align: end!important;} @media only screen and (min-width: 992px){.ImpreseeModal:not(.ImpreseeMobile){max-width:1330px !important;}}#ImpreseeTextResultsModalId .ImpreseeCollapsible {border-bottom: none!important; padding-bottom: 0!important;}.ImpreseeCollapsible__contentInner.Collapsible__contentInner_values label:hover{color: #000!important;}.ImpreseeCollapsible__contentInner.Collapsible__contentInner_values label{color: #777!important; cursor: pointer;}.ImpreseeBar {display: none!important;}.ui-jolisearch{display:none!important;} .ImpreseeMobileFilterButtonContainer button {display: inline-block!important;} .ImpreseeCollapsible__contentInner p {display: flex!important; flex-direction: row!important;} .ImpreseeGeneralModalOverlay.ImpreseeModalOverlay.ImpreseeEmbeddedResults { box-shadow: none !important; min-height: auto!important; } .ImpreseeCollapsible__contentInner.Collapsible__contentInner_values label { text-align: left !important; }'; document.getElementsByTagName('head')[0].appendChild(_wseeCss); var _wseeCss2 = document.createElement('style'); _wseeCss2.type = 'text/css'; _wseeCss2.innerHTML = '.ImpreseeSimpleProduct .ImpreseeProductPrices{flex-direction: column!important;}.ImpreseeTexts{padding:2px !important;}@media only screen and (min-width: 992px){.ImpreseeArrowDown{display: none!important;}.ImpreseeCollapsible__trigger{pointer-events: none !important;} .ImpreseeSimpleProductGrid{grid-template-columns:repeat(4, 25%)!important;}.ImpreseeDropDownContainer{min-width: 1000px;max-width:1064px;}.ImpreseeModal:not(.ImpreseeMobile) .ImpreseeSearchResultsContainer{ width: calc(80% - 30px)!important;}.ImpreseeModal:not(.ImpreseeMobile) .ImpreseeFullTextSearchResultsScreen .ImpreseeFiltersColumn{ width: calc(20% - 12px)!important;} .ImpreseeDropDownProductsDiv, .ImpreseeDropDownContainer section, .ImpreseeSimpleProductGrid, .ImpreseeDropDownProductsDiv, .ImpreseeDropDownResultsDesktopLower{width:100% !important;} .ImpreseeSimpleProductGrid{min-width: 100%;}}'; _wseeCss2.innerHTML += '.ImpreseePromotedProductsTitle img{max-height:20px!important; max-width: 20px!important;}@media only screen and (min-width: 768px) { .ImpreseeModalOverlay{z-index: 9!important;}}' _wseeCss2.innerHTML += '.tvsearch-result,.half-wrapper-backdrop{display:none!important;}' document.getElementsByTagName('head')[0].appendChild(_wseeCss2); // add to cart var _wseeCssAddToCart = document.createElement('style'); _wseeCssAddToCart.type = 'text/css'; _wseeCssAddToCart.innerHTML = '.ImpreseeDropDownContainer{z-index: 999!important;}.ImpreseeSimpleProduct .ImpreseeAddToCart{ font-size: 0.8em !important;}.ImpreseeAddToCart span{color: white!important;line-height: inherit!important;}.ImpreseeAddToCart{min-height:auto!important; line-height: inherit!important; border: medium;border-radius: 25px !important;font-size: 13px !important;padding: 10px 20px !important;text-transform: uppercase;background: #f6509d none repeat scroll 0 0 !important;max-width: max-content !important;text-align: center;align-self: center;}.ImpreseeAddToCart:hover{background: #000!important;border-color: transparent;color: #fff;}' _wseeCssAddToCart.innerHTML += '.ImpreseeDropDownContainer.ImpreseeMobile {background-color: transparent!important;}.ImpreseeDropDownContainer.ImpreseeMobile section{background-color:white!important;}' document.getElementsByTagName('head')[0].appendChild(_wseeCssAddToCart); var _wseeMeta = document.createElement('meta'); _wseeMeta.name = "viewport"; _wseeMeta.content = "width=device-width, initial-scale=1, maximum-scale=1"; document.getElementsByTagName('head')[0].appendChild(_wseeMeta); /** snippet configuration */ window._wssee = window._wssee || []; window._wssee.push({ setup: { photoButton: "search-by-photo", photoApp: "d0122d1c-dc32-45cb-97a7-420fe0565ebe", useSearchByPhoto: true, skecthButton: "search-by-sketch", sketchApp: "d0122d1c-dc32-45cb-97a7-420fe0565ebe", useSearchBySketch: false, useAddToCartButton: true, loadAfterPageRender: true, useDetection: true, addSearchDataToUrl: false, displayOnSaleProducts: true, onlyCameraAsInput: false, disableImageCrop: false, mainColor: "#cc2c23", numberFractionDigits: 0, thousandsSeparator: ".", decimalSeparator: ",", currencySymbolAtTheEnd: false, colorOnSale: "#cc2c23", afterLoadResults: function (searchType) { /* */ let embeddedResultsContainer = document.querySelector("#main"); if (embeddedResultsContainer) { onPressChangeDistribution(); } if (searchType === "text" || searchType === "search change page") { window.setTimeout(function() { window.scrollTo(0, 0) }, 200); } if (searchType === "text") { let html = document.querySelector("html"); html.style.overflowX = "hidden"; let changeDistributionButtons = document.querySelectorAll( ".ImpreseeChangeDisplayFormatButton" ); } for (product of Array.from(document.querySelectorAll('.ImpreseeProduct'))) { var onSaleSign = product.querySelector('.ImpreseeOnSaleSign'); if (parseInt(product.dataset.original_price) != parseInt(product.dataset.price) && parseInt(product.dataset.original_price) > parseInt(product.dataset.price)) { if (onSaleSign) onSaleSign.style.display = 'inline-block'; } else { if (onSaleSign) onSaleSign.style.display = 'none'; } if (product.querySelector('.impresee-rd-price') == null && parseInt(product.dataset.original_price) != parseInt(product.dataset.price) && parseInt(product.dataset.original_price) > parseInt(product.dataset.price)) { var productPrice = product.querySelector('.ImpreseeTexts .ImpreseePrice'); if (!productPrice) continue; var discountLabel = document.createElement('span'); discountLabel.classList.add('discount-percentage'); discountLabel.style.padding = '3px 5px'; discountLabel.style.margin = '0 3px'; discountLabel.innerHTML = (-1 * Math.round(((parseInt(product.dataset.original_price) - parseInt(product.dataset.price)) / parseInt(product.dataset.original_price)) * 100 * 100) / 100) + '%'; productPrice.appendChild(discountLabel); } else if (product.querySelector('.impresee-rd-price') && parseInt(product.dataset.original_price) != parseInt(product.dataset.price) && parseInt(product.dataset.original_price) > parseInt(product.dataset.price)) { product.querySelector('.discount-percentage').innerHTML = (-1 * Math.round(((parseInt(product.dataset.original_price) - parseInt(product.dataset.price)) / parseInt(product.dataset.original_price)) * 100 * 100) / 100) + '%'; } else { if (product.querySelector('.impresee-rd-price')) product.querySelector('.impresee-rd-price').remove(); if (product.querySelector('.ImpreseePrice .discount-percentage')) product.querySelector('.discount-percentage').remove(); } } for (product of Array.from(document.querySelectorAll('.ImpreseeProduct, .ImpreseeSimpleProduct'))) { if (product.querySelector('.ImpreseePrice') && product.querySelector('.impresee-price-label') == null) { var priceLabel = document.createElement('span'); priceLabel.classList.add('impresee-price-label'); if (parseInt(product.dataset.original_price) != parseInt(product.dataset.price) && parseInt(product.dataset.original_price) > parseInt(product.dataset.price)) { priceLabel.innerHTML = 'Oferta online '; } product.querySelector('.ImpreseePrice').insertBefore(priceLabel, product.querySelector('.ImpreseePrice').firstChild); } if (product.querySelector('.ImpreseeNormalPrice') && product.querySelector('.impresee-normal-price-label') == null) { var normalPriceLabel = document.createElement('span'); normalPriceLabel.classList.add('impresee-normal-price-label'); normalPriceLabel.style.display = 'inline-block'; normalPriceLabel.style.marginRight = '3px'; normalPriceLabel.innerHTML = 'Precio Retail: '; product.querySelector('.ImpreseeNormalPrice').insertBefore(normalPriceLabel, product.querySelector('.ImpreseeNormalPrice').firstChild); } if (product.querySelector('.stars-container') == null) { var productTexts = product.querySelector('.ImpreseeTexts'); if (!productTexts) continue; var stars = document.createElement('div'); stars.style.textAlign = 'center'; stars.style.marginTop = '10px'; stars.classList.add('stars-container'); var imageContainer = document.createElement('div'); imageContainer.style.display = 'table'; imageContainer.style.margin = '-10px auto 10px auto'; stars.appendChild(imageContainer); var starsImage = document.createElement('img'); starsImage.src = '/modules/lgcomments/views/img/stars/plain/yellow/' + (product.dataset.stars * 2 || 0) + 'stars.png'; starsImage.alt = 'rating'; starsImage.style.width = '120px'; starsImage.classList.add('impresee-stars'); stars.appendChild(starsImage); var numberReviews = document.createElement('span'); numberReviews.style.width = '100px'; numberReviews.style.textAlign = 'center'; numberReviews.innerHTML = '(' + (product.dataset.number_reviews || 0) + ')'; numberReviews.classList.add('impresee-reviews'); stars.appendChild(numberReviews); productTexts.parentNode.insertBefore(stars, productTexts); } else { product.querySelector('.stars-container .impresee-stars').src = '/modules/lgcomments/views/img/stars/plain/yellow/' + (product.dataset.stars * 2 || 0) + 'stars.png'; product.querySelector('.stars-container .impresee-reviews').innerHTML = '(' + (product.dataset.number_reviews || 0) + ')'; } let addToCartButton = product.querySelector('.ImpreseeAddToCartContainer'); if (product.querySelector('.ImpreseeCuotas') == null) { var cuotasLabel = document.createElement('p'); cuotasLabel.style.fontSize = '0.9em'; cuotasLabel.style.padding = '0 5%'; cuotasLabel.classList.add('ImpreseeCuotas'); cuotasLabel.innerHTML = "En 3 cuotas de "; cuotasLabel.innerHTML += "" + impreseeNumberWithPoint(Math.round(product.dataset.price / 3)) + " $"; cuotasLabel.innerHTML += " sin interés."; if (addToCartButton && product.querySelector('.ImpreseeItem')) { product.querySelector('.ImpreseeItem').insertBefore(cuotasLabel, addToCartButton); } else { product.appendChild(cuotasLabel); } } else { product.querySelector('.ImpreseeCuotas').innerHTML = "En 3 cuotas de "; product.querySelector('.ImpreseeCuotas').innerHTML += "" + impreseeNumberWithPoint(Math.round(product.dataset.price / 3)) + " $"; product.querySelector('.ImpreseeCuotas').innerHTML += " sin interés."; } /* tester image */ _seeAddTesterImage(product); } }, beforeLoadResults: function (searchType) { if (searchType === "text") { let sectionsToHide = document.querySelectorAll('section#content,.display-topcolumn,.display-bannertv,.display-hometop,.breadcumb_outer,.display-homebottom,section#wrapper .container,section.product-tabs,#custom-parallaxblock,#lgcomments-owl,.slider-title-container,.lgcomments-see-more'); for (const section of Array.from(sectionsToHide)) { section.classList.add("ImpreseeHide"); } } }, parsePriceFunction: function (on_sale, product) { if (!product) return; if (!on_sale) { return impreseeNumberWithPoint(Math.round(product.from_price || product.price_from)) + ' $'; } return impreseeNumberWithPoint(Math.round(product.price)) + " $"; }, onSearchFailed: function () { }, onCloseResults: function () { }, onClickAddToCart: function(product){ impreseeAddToCart(product); }, }, searchByText: { useText: true, searchBarSelector: "input[name=s]", textSearchApp: 'd0122d1c-dc32-45cb-97a7-420fe0565ebe', extraPressSeeAllButton: "button.tvheader-search-btn", searchDelayMilis: 300, fullTextSearchContainerSelector: "#main", instantFull: true, computeTopFromElement: "header", useButtonAsSearchBar: false, buttonSearchBarLocation: "BOTTOM_LEFT", pressSeeAll: function(queryText) { var media_query = 'screen and (max-width: 767px)'; var matched = window.matchMedia(media_query).matches; if(matched) return; var close_button = document.querySelector('.search-button-close-wrapper'); if(close_button) close_button.click(); }, onCloseResults: function() { var media_query = 'screen and (max-width: 767px)'; var matched = window.matchMedia(media_query).matches; if(matched) return; var close_button = document.querySelector('.search-button-close-wrapper'); if(close_button) close_button.click(); }, onOpenDropDownResults: function() { }, }, texts: { addToCart: "AÑADIR AL CARRITO", visualSearchTitle: "Empieza a escribir para buscar", goToProductDetailsButtonLabel: "Ver más", searchResultsTitle: "Resultados de búsqueda", searchButtonLabel: "Buscar", errorTitle: "Ups, parece que hubo un problema ", errorMessage: "Al parecer nuestro sistema está con problemas, intenta nuevamente ", dragAndDropImageTitle: "Arrastra una imagen o haz click aquí", dragAndDropImageMessage: "Carga la imagen que te gustaría usar para la búsqueda", startWriting: "Escribe para buscar", currencySymbol: "$", searchByPhoto: "Búsqueda por imagen", searchBySketch: "Búsqueda por dibujo", seeAllResults: "Ver todos los resultados", noMatchingResult: "No hay resultados", onSale: "Oferta", resultsTitleforTextSearch: "Resultados para {1}", numberResultsTitle: "Mostrando {1} resultados", resultsTitleForMobile: 'Mostrando {1} resultados para "{2}"', filtersTitle: "Filtros", clearFilters: "Borrar filtros", sortBy: "Ordenar por", applyFilters: "Aplicar", tryAgainWhenNoResults: "¿Porqué no intentas subiendo una imagen o dibujando de lo que buscas?", oops : "Ups...", error : "No esperabamos esto.", errorDescription : "Parece que nuestro sistema se sobrecalentó, inténtalo de nuevo luego.", customSelectionSearchLabel : "Búsqueda personalizada", recommendedCategories : "Categorías recomendadas", searchRecommendedProducts: "Productos recomendados", searchSuggestions: "Búsquedas populares", queryTextAutocorrect: "Tal vez quisiste decir: {1}", }, }); function disableSearchForm(inputSelector) { var searchBars = document.querySelectorAll(inputSelector); for (searchBar of Array.from(searchBars)){ var searchForm = searchBar.parentNode; searchForm.addEventListener('submit',(event) => {event.stopPropagation();event.preventDefault();return false;}, true); } } var impresee = document.createElement("script"); impresee.type = "text/javascript"; impresee.async = true; impresee.src = "https://cdn.impresee.com/snippet/v5.9/impresee.min.js"; disableSearchForm("input[value=search]"); var first = document.getElementsByTagName("script")[0]; first.parentNode.insertBefore(impresee, first); } function _seeAddTesterImage(product){ var divTester = product.querySelector('.impresee-tester'); if ("Tester" === product.dataset.tester) { if (divTester == null) { divTester = document.createElement('div'); divTester.classList.add('impresee-tester'); divTester.style.position = 'absolute'; divTester.style.right = '10px'; divTester.style.top = '10px'; divTester.style.width = '50px'; divTester.style.height = '50px'; divTester.innerHTML = 'Tester product'; product.appendChild(divTester); } } else if (divTester) { divTester.remove(); } }