PageSourceSearch

https://discountscooters.co.uk/cdn/shop/t/29/assets/hp-vat-handle.js?v=73680116243752649081664535148

js discountscooters.co.uk collected 2026-10-02 21:14:32 UTC 5,242 bytes, 2 lines download raw bytes

1var addBasket=document.querySelector(".add-basket"),optionsSelection=document.querySelectorAll(".options-selection__input-selectt"),productForm=document.querySelector(".product-form--regular form"),option_1=optionsSelection[0],option_2=optionsSelection[1];(function(){var vatSelectorLabel=document.querySelector('[data-variant-option-name="vat"]');if(vatSelectorLabel){var vatSelector=vatSelectorLabel.parentNode;vatSelector.style.display="none"}})(),(function(){if(optionsSelection.length>0){console.log("Option is equal 1");var cartProductVat=document.querySelector("#product-quantity-select").getAttribute("data-cart-product"),vatSelection2=optionsSelection[optionsSelection.length-1];setTimeout(()=>{console.log("vat selection ",vatSelection2),cartProductVat=="eligible"?(vatSelection2.value=vatSelection2.querySelectorAll("option")[0].value,vatSelection2.dispatchEvent(new Event("change"))):(vatSelection2.value=vatSelection2.querySelectorAll("option")[1].value,vatSelection2.dispatchEvent(new Event("change")))},1)}})(),addBasket?.addEventListener("click",function(e){e.preventDefault(),validateForm()&&(document.getElementById("id01").style.display="block",document.querySelector("body").style.overflow="hidden")});function validateForm(){let isFormValid=!0;return optionsSelection.forEach((selector,i)=>{selector.value==="not-selected"&&i!==optionsSelection.length-1&&(productForm.classList.add("product-form--error-option-unselected"),isFormValid=!1)}),isFormValid||setTimeout(()=>new MessageBanner(window.labels.select_variant,"error"),0),console.log("isFormValid",isFormValid),isFormValid}if(optionsSelection.length>0)var vatSelection=optionsSelection[optionsSelection.length-1],vatOption_1=vatSelection[0],vatOption_2=vatSelection[1];$("#option2").change(function(){$("#required_later").prop("required",!1),$("#required_later").prop("disabled",!0),vatSelection&&(vatSelection.value=vatOption_2.value,vatSelection.dispatchEvent(new Event("change")))}),$("#option1").change(function(){$("#required_later").prop("required",!0),$("#required_later").prop("disabled",!1),$("#required_later").focus(),vatSelection.value=vatOption_1.value,vatSelection.dispatchEvent(new Event("change"))}),$("input[name=id]").change(function(){this.id=="option1"?$("#cartnote").show("slow"):$("#cartnote").hide("")}),$("#required_later").change(function(){$("#vat_reason").val($("#required_later").val())}),$(".product-dc-btn-text").click(function(){document.getElementById("id01").style.display="none",document.querySelector("body").style.overflow="auto"}),$(".product-dc-close-button").click(function(){document.getElementById("id01").style.display="none",document.querySelector("body").style.overflow="auto"}),submitButton();function submitButton(){var submitBtn=document.querySelector("#add"),productForm2=document.querySelector(".product-form--regular form"),option1=document.querySelector("#option1"),option2=document.querySelector("#option2"),textarea=document.querySelector("#required_later");submitBtn&&submitBtn.addEventListener("click",function(e){option1.checked==!1&&option2.checked==!1||option1.checked==!0&&textarea.value==!1?e.preventDefault():productForm2.submit()})}var cartNote=$("#cart-note"),cartPopupBtn=$(".template-cart .custom-html--container span");cartNote.val()==""?$(".template-cart .custom-html--container").css("display","block"):$(".template-cart .custom-html--container").css("display","none"),cartPopupBtn.click(function(e){$("#id02").css("display","block"),$("body").css("overflow","hidden")}),$(".cart-popup-close-btn").click(function(e){$("#id02").css("display","none"),$("body").css("overflow","auto")}),$(".cart-dc-btn-text").click(function(e){$("#id02").css("display","none"),$("body").css("overflow","auto")});function vatLabel(){var allOptions=document.querySelectorAll(".cart-item--product-options");allOptions.forEach(function(option){option.innerText=="vat I am VAT exempt"?(option.innerText="VAT EXEMPT",option.setAttribute("style","background-color: #4c995c; color: #fff; font-weight: 700; padding: 5px 5px; width: 110px; text-align: center")):option.innerText=="vat I am not VAT exempt"&&(option.innerText="Not VAT exempt",option.setAttribute("style","padding: 5px 0px"))})}vatLabel();function addNonVatSubtotal(){var allNonVatItems=document.querySelectorAll("[data-hp--nonvat-total-price]"),allVatItems=document.querySelectorAll("[data-hp--vat-total-price]"),totalNonVatPrice
1=0,totalVatPrice=0,vatPrice=0;allNonVatItems.forEach(item=>{var price=parseInt(item.getAttribute("data-hp--nonvat-total-price"));totalNonVatPrice+=price}),allVatItems.forEach(item=>{var price=parseInt(item.getAttribute("data-hp--vat-total-price"));totalVatPrice+=price}),vatPrice=totalNonVatPrice*.2,totalVatPrice+=totalNonVatPrice+vatPrice,document.querySelector(".subtotal-small .money-small")&&(document.querySelector(".subtotal-small .money-small").innerHTML=Shopify.formatMoney(vatPrice,"\xA3{{amount}}")),document.querySelectorAll("[data-cart-total]")&&document.querySelectorAll("[data-cart-total]").forEach(function(el){el.innerHTML=Shopify.formatMoney(totalVatPrice,"\xA3{{amount}}")})}setTimeout(()=>addNonVatSubtotal(),1e3);
2//# sourceMappingURL=/cdn/shop/t/29/assets/hp-vat-handle.js.map?v=73680116243752649081664535148

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.