The UK’s Best Web Hosting Provider


Dedicated Servers UK | Best Managed Server Provider UK for 2019 Facebook ISPA Winner 2018

Opens in a new window Opens an external site Opens an external site in a new window

row.startsWith(‘ksite_include’)) ? document.cookie .split(‘; ‘) .find(row => row.startsWith(‘ksite_include’)) .split(‘=’)[1] === ‘1’ : false; let regularityStatus = ‘monthly’ // Add on click event to order buttons const setOrderLinks = () => { Array.from(orderButtons).forEach(btn => { btn.addEventListener(‘click’, () => { // Add spinner btn.innerHTML = ‘‘; let productID = btn.dataset.level billingCycle = (function() { if (typeof btn.dataset.billingCycle === “undefined”) { return regularityStatus; } else { return btn.dataset.billingCycle; } })(), promoCode = btn.dataset.promoCode; /* * Make XHR request to fetch JSON payload containing the * add to cart URL and the payload to send to Google Analytics. * If the fetch fails the user it still sent to the cart. */ const formData = new FormData(); formData.append(‘task’, ‘AddToCart’); formData.append(‘productID’, productID); formData.append(‘billingCycle’, billingCycle); formData.append(‘promoCode’, promoCode); const postData = { method: ‘POST’, body: formData } fetch(‘/client/cart_utilities.php’, postData) .then(response => response.json()) .then(response => { window.dataLayer = window.dataLayer || []; window.dataLayer.push(response.GA4); window.location.href = response.URL; }) .catch((error) => { console.log(‘[Add To Cart]: Error occured in fetch request. GA4 event did not fire.’); window.location.href = ‘/client/cart.php?a=add&pid=’+productID+’&billingcycle=’+billingCycle+’&promocode=’+promoCode; }); }) }) } setOrderLinks(); // Will use this function to change return based on VAT toggle let vatAdjust = (input) => { return vatStatus ? input * 1.2 : input; } const vatElModifier = (el) => { if (vatStatus) { el.textContent = ‘£’ + (Number(el.textContent.slice(1))*1.2).toFixed(2) } else { el.textContent = ‘£’ + (Number(el.textContent.slice(1))/1.2).toFixed(2) } } const vatToggle = () => { vatStatus = vatToggleButton.checked; setPrices(); } const setPrices = () => { // This function will be called when changes are made to set prices if(priceChangeInProgress) return; priceChangeInProgress = true; Array.from(allPriceLabels).forEach(el => {el.classList.add(‘price-fade’)}) setTimeout(() => { Array.from(priceLabels).forEach((price, i) => { priceLabels[i].textContent = ‘£’ + vatAdjust(webHostingPrices[regularityStatus][i]).toFixed(2) }) if (showcasePriceLabels.length > 0 && showcasePriceLabels[0].previousSibling.previousSibling.textContent === ‘Sapphire’) { Array.from(showcasePriceLabels).forEach((price, i) => { showcasePriceLabels[i].textContent = ‘£’ + vatAdjust(webHostingPrices[regularityStatus][i+2]).toFixed(2) }) } else if (showcasePriceLabels.length > 0 && showcasePriceLabels[0].previousSibling.previousSibling.textContent === ‘Web Hosting’) { Array.from(showcasePriceLabels).forEach((price, i) => { showcasePriceLabels[i].textContent = ‘£’ + vatAdjust(showcaseHostingPrices[‘monthly’][i]).toFixed(2) }) } else { Array.from(showcasePriceLabels).forEach((price, i) => { showcasePriceLabels[i].textContent = ‘£’ + vatAdjust(webHostingPrices[regularityStatus][i]).toFixed(2) }) } Array.from(allPriceLabels).forEach(el => {el.classList.remove(‘price-fade’)}) setTimeout(() => {priceChangeInProgress = false}, 200); }, 300) } if (vatStatus) vatToggle(); vatToggleButton.addEventListener(‘change’, () => {vatToggle();}) Array.from(priceCheckbox).forEach(el => { el.addEventListener(‘click’, e => { if (e.currentTarget.dataset.regularity !== regularityStatus) { regularityStatus = e.currentTarget.dataset.regularity let row = ” if (regularityStatus === ‘monthly’) { row = 0 } else if (regularityStatus === ‘annually’) { row = 1 } else if (regularityStatus === ‘triennially’) { row = 2 } if (onyxRows.length) { Array.from(onyxRows).forEach(el => { el.style.display = ‘none’ }) Array.from(onyxRows)[row].style.display = ‘table-row’ } Array.from(priceCheckbox).forEach(el => { el.checked = false }) Array.from(document.getElementsByClassName(`${regularityStatus}-checkbox`)).forEach(el => { el.checked = true }) setPrices() } }) }) // TABLE EXPANSION const expandableEls = document.getElementsByClassName(‘hidden table-expand’) const heroButton = document.getElementsByClassName(‘table-expand-button’) Array.from(heroButton).forEach(el => { el.addEventListener(‘click’, () => { Array.from(expandableEls).forEach(el => {el.classList.remove(‘hidden’)}) tableWrapper.classList.add(‘plan-table-expanded’) tableOuterWrapper.classList.add(‘table-expanded’) }) }) // INIT SCRIPTS // Site booted, check VAT state let vueInitCheckVatTimeout = setInterval(() => { if(typeof KSite_Vue == ‘undefined’) return; vatStatus = !!KSite_Vue.include_vat; vatToggle(); clearTimeout(vueInitCheckVatTimeout); }, 200); // Cart booted, add discount code? let cartInitTimeout = setInterval(() => { if(typeof TKCart == ‘undefined’) return; clearTimeout(cartInitTimeout); let discountCode = (new URLSearchParams(window.location.search)).get(‘discount’); if(!discountCode) return; TKCart.Cart._Misc._Discount_Apply(discountCode, () => {}) // empty error handler, do not block UI if the discount could not be applied }, 200); ]]>

Source