Skip to content We use our own and third party cookies to improve the user experience through your browsing. If you continue browsing you accept its use.
CLOSE
Privacy & Cookies Policy
‘ );( document.contains ) || document.write( ” + ‘ipt>’ );( window.DOMRect ) || document.write( ” + ‘ipt>’ );( window.URL && window.URL.prototype && window.URLSearchParams ) || document.write( ” + ‘ipt>’ );( window.FormData && window.FormData.prototype.keys ) || document.write( ” + ‘ipt>’ );( Element.prototype.matches && Element.prototype.closest ) || document.write( ” + ‘ipt>’ ); ]]> { if(el.classList.contains(“has-dropdown”)) { el.classList.add(“current-dropdown”); } event.preventDefault(); }); el.addEventListener(“focusout”,(event)=>{ if(el.classList.contains(“current-dropdown”)) { el.classList.remove(“current-dropdown”); } event.preventDefault(); }); }); var menuTopItems = document.querySelectorAll(‘ul.nav.top-bar-nav.nav-right li’); Array.prototype.forEach.call(menuTopItems, function(el, i){ el.addEventListener(“focusin”,(event) => { if(el.classList.contains(“has-dropdown”)) { el.classList.add(“current-dropdown”); } event.preventDefault(); }); el.addEventListener(“focusout”,(event)=>{ if(el.classList.contains(“current-dropdown”)) { el.classList.remove(“current-dropdown”); } event.preventDefault(); }); }); //Issue 5 var btnSearchSubmit = document.querySelectorAll(‘button[id=yith-searchsubmit]’); Array.prototype.forEach.call(btnSearchSubmit,function(el,i){ el.id = el.id + “_” + i; }); var btnPostSubmit = document.querySelectorAll(‘input[id=yit_wcas_post_type]’); Array.prototype.forEach.call(btnPostSubmit,function(el,i){ el.id = el.id + “_” + i; }); //SHOP var subMenuShopLastChild = document.querySelectorAll(‘ul[id=”site-navigation”] li.menu-item-has-children div.nav-dropdown ul li div ul’); Array.prototype.forEach.call(subMenuShopLastChild, function(el, i){ el.lastElementChild.addEventListener(“focusout”,(event) => { el.parentNode.parentNode.parentNode.parentNode.parentNode.classList.remove(‘active’); event.preventDefault(); }); }); //AUTH SHOP var subMenuAuthorizeShop = document.querySelectorAll(‘ul[id=”site-navigation”] li.menu-parent-item’); Array.prototype.forEach.call(subMenuAuthorizeShop, function(el, i){ if(i ===2) { el.lastElementChild.lastElementChild.lastElementChild.addEventListener(“focusout”,(event) => { el.classList.remove(‘active’); event.preventDefault(); }); } }); //SEARCH var searchItem = document.querySelectorAll(‘button[id=”yith-searchsubmit_0″]’); Array.prototype.forEach.call(searchItem, function(el, i){ el.addEventListener(“focusout”,(event) => { document.querySelector(‘ul[id=”site-navigation”] li.search-dropdown’).classList.remove(‘active’); event.preventDefault(); }); }); //agregar alt a hr; var hr_items = document.querySelectorAll(‘hr’); Array.prototype.forEach.call(hr_items,function(el,i) { var anchorLabel = el; anchorLabel.setAttribute(‘alt’, “”); }); //hide back-image var hide_images = document.querySelectorAll(‘div.back-image’); Array.prototype.forEach.call(hide_images,function(el,i) { var anchorLabel = el jQuery(anchorLabel).remove(); }); var icon_search = document.querySelectorAll(‘a.icon-search’); Array.prototype.forEach.call(icon_search,function(el,i) { var anchorLabel = el; if(language ===”English”) anchorLabel.setAttribute(‘aria-label’,”Search products”); else anchorLabel.setAttribute(‘aria-label’, “Buscar productos”); anchorLabel.setAttribute(‘ROLE’,”button”); }); var star_rating = document.querySelectorAll(‘div.star-rating’); Array.prototype.forEach.call(star_rating,function(el,i) { var anchorLabel = el; var result = el.getAttribute(“Title”); el.removeAttribute(“Title”); if(language ===”English”) result = result + ” stars”; else result = result + ” estrellas”; anchorLabel.setAttribute(‘aria-label’,result); var spanElement = anchorLabel.firstElementChild; spanElement.innerText = “”; }); var star_1 = document.querySelector(‘a.star-1’); if(star_1 !== null) { if(language ===”English”) { star_1.setAttribute(‘aria-label’,”Give 1 star rating”); star_1.setAttribute(‘ROLE’,”button”); var star_2 = document.querySelector(‘a.star-2’); star_2.setAttribute(‘aria-label’,”Give 2 star rating”); star_2.setAttribute(‘ROLE’,”button”); var star_3 = document.querySelector(‘a.star-3’); star_3.setAttribute(‘aria-label’,”Give 3 star rating”); star_3.setAttribute(‘ROLE’,”button”); var star_4 = document.querySelector(‘a.star-4’); star_4.setAttribute(‘aria-label’,”Give 4 star rating”); star_4.setAttribute(‘ROLE’,”button”); var star_5 = document.querySelector(‘a.star-5’); star_5.setAttribute(‘aria-label’,”Give 5 star rating”); star_5.setAttribute(‘ROLE’,”button”); } else { star_1.setAttribute(‘aria-label’,”Calificar 1 estrella”); star_1.setAttribute(‘ROLE’,”button”); var star_2 = document.querySelector(‘a.star-2’); star_2.setAttribute(‘aria-label’,”Calificar 2 estrellas”); star_2.setAttribute(‘ROLE’,”button”); var star_3 = document.querySelector(‘a.star-3’); star_3.setAttribute(‘aria-label’,”Calificar 3 estrellas”); star_3.setAttribute(‘ROLE’,”button”); var star_4 = document.querySelector(‘a.star-4’); star_4.setAttribute(‘aria-label’,”Calificar 4 estrellas”); star_4.setAttribute(‘ROLE’,”button”); var star_5 = document.querySelector(‘a.star-5’); star_5.setAttribute(‘aria-label’,”Calificar 5 estrellas”); star_5.setAttribute(‘ROLE’,”button”); } } //Remover links de product info //var divCategoria = document.querySelectorAll(‘div.text-center.ll-at-font.ll-at-size.ll-at-line-height’); var divCategoria = document.querySelectorAll(‘p.category’); Array.prototype.forEach.call(divCategoria,function(el,i) { jQuery(el).remove(); }); var divInfo = document.querySelectorAll(‘div.text-center.ll-at-font.ll-at-size.ll-at-line-height’); if(divInfo.length>0) { Array.prototype.forEach.call(divInfo,function(el,i) { var allAnchors = el.querySelectorAll(‘a.ll-at-font.ll-at-size.ll-at-line-height’) Array.prototype.forEach.call(allAnchors,function(anchor,x) { anchor.setAttribute(‘href’, “#”); }); }); } //Issue 29 var btndelPrice = document.querySelectorAll(‘del’); Array.prototype.forEach.call(btndelPrice,function(el,i){ if(language ===”English”) el.setAttribute(‘aria-label’,”Previous price”); else el.setAttribute(‘aria-label’,”Precio anterior”); }); var btnInsPrice = document.querySelectorAll(‘ins’); Array.prototype.forEach.call(btnInsPrice,function(el,i){ if(language ===”English”) el.setAttribute(‘aria-label’,”New price”); else el.setAttribute(‘aria-label’,”Nuevo precio”); }); //prev y next anchors; var prevAnchor = document.querySelectorAll(‘ul li a.prev.page-number’); Array.prototype.forEach.call(prevAnchor,function(el,i){ if(language ===”English”) el.setAttribute(‘aria-label’,”Previous”); else el.setAttribute(‘aria-label’,”Anterior”); }); var nextAnchor = document.querySelectorAll(‘ul li a.next.page-number’); Array.prototype.forEach.call(nextAnchor,function(el,i){ if(language ===”English”) el.setAttribute(‘aria-label’,”Next”); else el.setAttribute(‘aria-label’,”Siguiente”); }); var currentPage = document.querySelectorAll(‘ul li span.page-number.current’); Array.prototype.forEach.call(currentPage,function(el,i){ var value = el.innerText; if(language ===”English”) el.setAttribute(‘aria-label’,”Current Page, Page ” + value); else el.setAttribute(‘aria-label’,”Página actual, pagina ” + value); }); var otherPages = document.querySelectorAll(‘ul li a.page-number:not(.prev):not(.next)’); Array.prototype.forEach.call(otherPages,function(el,i){ var value = el.innerText; if(language ===”English”) el.setAttribute(‘aria-label’,”Go to page ” + value); else el.setAttribute(‘aria-label’,”Ir a pagina ” + value); }); var zoomButton = document.querySelectorAll(‘a.zoom-button.tip-top.hide-for-small.tooltipstered.ll-at-font.ll-at-size.ll-at-line-height’); Array.prototype.forEach.call(zoomButton,function(el,i){ el.setAttribute(‘aria-label’,”Zoom”); }); var iframesChat = document.querySelectorAll(‘iframe[title=”chat widget”]’); Array.prototype.forEach.call(iframesChat,function(el,i){ if(language ===”English”) { if(i===0) { el.title = “Chat widget send message window”; } else if(i===1) { el.title = “Open chat widget”; } else if(i===2) { el.title = “Chat widget options” } else if(i===3) { el.title = “Chat widget information box” } } else { if(i===0) { var disclaimer = document.createElement(“input”) var msg = “Este es un widget de chat de proveedores de terceros impulsado por Tawk.to. Si tiene algún problema, contáctenos en admin@marketersengine.com” disclaimer.type=”text”; disclaimer.readOnly = true; disclaimer.value =msg; disclaimer.setAttribute(‘aria-label’,msg); disclaimer.style.opacity=1; el.parentNode.insertBefore(disclaimer,el.parentNode.childNodes[0]); el.title = “Ventana de envío de mensaje de widget de chat”; } else if(i===1) { el.title = “Abrir widget de chat”; } else if(i===2) { el.title = “Opciones de widget de chat”; } else if(i===3) { el.title = “Cuadro de información del widget de chat”; } } }); //my-account var accountFirstName = document.querySelectorAll(‘label[for=”account_first_name”]’); Array.prototype.forEach.call(accountFirstName,function(el,i){ el.innerText = “First Name (Required)”; }); var accountLastName = document.querySelectorAll(‘label[for=”account_last_name”]’); Array.prototype.forEach.call(accountLastName,function(el,i){ el.innerText = “Last Name (Required)”; }); var accountEmail = document.querySelectorAll(‘label[for=”account_email”]’); Array.prototype.forEach.call(accountEmail,function(el,i){ el.innerText = “Email (Required)”; }); //billing address var labelsRequired = document.querySelectorAll(‘abbr.required[title=”required”]’); Array.prototype.forEach.call(labelsRequired ,function(el,i){ el.parentNode.innerText = el.parentNode.innerText.replace(‘*’,’ (Required)’); el.remove(); }); //display name var labelDisplayName = document.querySelectorAll(‘label[for=”account_display_name”] span’); Array.prototype.forEach.call(labelDisplayName ,function(el,i){ el.parentNode.innerText = el.parentNode.innerText.replace(‘*’,’ (Required)’); el.remove(); }); var spanRequired = document.querySelectorAll(‘label span.required’); Array.prototype.forEach.call(spanRequired ,function(el,i){ el.parentNode.innerText = el.parentNode.innerText.replace(‘*’,’ (Required)’); el.remove(); }); //remove top link var topLink = document.querySelectorAll(‘a[id=”top-link”]’); Array.prototype.forEach.call(topLink,function(el,i){ jQuery(el).remove(); }); var minusButton = document.querySelectorAll(‘input.minus.button.is-form’); Array.prototype.forEach.call(minusButton,function(el,i){ el.setAttribute(‘aria-label’,”Remove 1″); }); var plusButton = document.querySelectorAll(‘input.plus.button.is-form’); Array.prototype.forEach.call(plusButton,function(el,i){ el.setAttribute(‘aria-label’,”Add 1″); }); var wpnoncesElements = document.querySelectorAll(‘input[id=_wpnonce]’); Array.prototype.forEach.call(wpnoncesElements,function(el,i){ el.id = el.id + “_” + i; }); //remove whishlist var whishlistElements = document.querySelectorAll(‘div.image-tools.absolute.top’); Array.prototype.forEach.call(whishlistElements,function(el,i){ jQuery(el).remove(); }); whishlistElements = document.querySelectorAll(‘div.wishlist-icon’); Array.prototype.forEach.call(whishlistElements,function(el,i){ jQuery(el).remove(); }); /* //remove abbr var abbrElements = document.querySelectorAll(‘abbr.required[title=”required”]’); Array.prototype.forEach.call(abbrElements,function(el,i){ //el.setAttribute(‘aria-label’,”This is a required field.”); el.remove(); }); //remove span required var span_required = document.querySelectorAll(‘span.required’); Array.prototype.forEach.call(span_required,function(el,i){ el.remove(); }); */ var productos = document.querySelectorAll(‘li.product-small’); Array.prototype.forEach.call(productos,function(el,i){ el.setAttribute(“tabindex”,”-1″); }); var skipElement = document.createElement(“a”); var spanElement = document.createElement(“span”); var divElement = document.createElement(“div”); skipElement.setAttribute(“href”,”#main”); spanElement.innerText = “Skip to main content”; skipElement.appendChild(spanElement); divElement.appendChild(skipElement); divElement.style.textAlign =”center”; divElement.style.backgroundColor =”lightgray”; document.body.insertBefore(divElement, document.body.firstChild); skipElement.addEventListener(“focusin”,(event) => { divElement.style.outline =”thick auto blue”; event.preventDefault(); }); skipElement.addEventListener(“focusout”,(event) => { divElement.style.outline =”thick solid blue”; event.preventDefault(); }); var divInnerSideBar = document.querySelectorAll(‘div.inner.sidebar-inner’); var skipElementInfo = document.createElement(“a”); var spanElementInfo = document.createElement(“span”); var divElementInfo = document.createElement(“div”); skipElementInfo.setAttribute(“href”,”#main”); skipElementInfo.innerText = “Skip to product info”; skipElementInfo.appendChild(spanElementInfo); divElementInfo.appendChild(skipElementInfo); divElementInfo.style.textAlign =”center”; divElementInfo.style.backgroundColor =”lightgray”; Array.prototype.forEach.call(divInnerSideBar,function(el,i){ el.insertBefore(divElementInfo,el.firstChild); }); /** Disable Ajax Call from WooCommerce on front page and posts*/ add_action( ‘wp_enqueue_scripts’, ‘dequeue_woocommerce_cart_fragments’, 11); function dequeue_woocommerce_cart_fragments() { if (is_front_page() || is_single() ) wp_dequeue_script(‘wc-cart-fragments’); } }); //Page loaded. ]]>
Source