Increase Search Engine Rankings – We Build High Quality Backlinks

industry.name === name); console.log(“Industry index:”, industry); if (industry === -1) return; const industryOption = industries[industry].option; console.log(“Industry option:”, industryOption); const index = data.findIndex(item => item.option === industryOption); console.log(“Data index:”, index); if (index === -1) { console.error(“No pricing data found for option:”, industryOption); return; } const linksDiv = […document.querySelectorAll(‘.link’)]; linksDiv.forEach((link) => { const attr = link.getAttribute(‘data-attr’); const el = link.querySelector(‘.link-price span’); const linkTotalPrice = link.querySelector(‘.link-total-price span’); const quantity = link.querySelector(‘.link-quantity’); const price = data[index][attr].price; console.log(`Price for ${attr}:`, price); totalCost = totalCost + (price * Number(quantity.textContent)); el.innerHTML = price; linkTotalPrice.innerHTML = Number(quantity.textContent) * price; }); document.querySelector(‘.summary-total-cost’).textContent = totalCost; links.forEach(link => link.category_name = select.options[select.selectedIndex].textContent); } function updateQuantity(el, type) { const attr = el.closest(‘.link’).getAttribute(‘data-attr’); const quantity = el.closest(‘.link-quantity-box’).querySelector(‘.link-quantity’); const price = el.closest(‘.link’).querySelector(‘.link-price span’); const totalPrice = el.closest(‘.link’).querySelector(‘.link-total-price span’); const totalLinks = document.querySelector(‘.summary-total-links’); const totalCost = document.querySelector(‘.summary-total-cost’); if (type === ‘plus’) { quantity.textContent = Number(quantity.textContent) + 1; totalPrice.textContent = Number(price.textContent) * Number(quantity.textContent); totalLinks.textContent = Number(totalLinks.textContent) + 1; totalCost.textContent = Number(totalCost.textContent) + Number(price.textContent); links.push({ category_name: select.options[select.selectedIndex].textContent, da: attr, product_name: attr === ‘da20’ ? ‘DA 20 or Below’ : attr === ‘da30’ ? ‘DA 30+’ : attr === ‘da40’ ? ‘DA 40+’ : attr === ‘da50’ ? ‘DA 50+’ : attr === ‘da60’ ? ‘DA 60+’ : ”, }); } else if (type === ‘minus’ && Number(quantity.textContent) > 0) { quantity.textContent = Number(quantity.textContent) – 1; totalPrice.textContent = Number(price.textContent) * Number(quantity.textContent); totalLinks.textContent = Number(totalLinks.textContent) – 1; totalCost.textContent = Number(totalCost.textContent) – Number(price.textContent); const index = links.findIndex(link => link.da === attr); if (index !== -1) { links.splice(index, 1); } } } // Initialize select options industries = industries.sort((a,b) => (a.name > b.name) ? 1 : ((b.name > a.name) ? -1 : 0)); industries.forEach(item => { const option = document.createElement(‘option’); option.value = item.option; option.dataset.id = item.id; option.textContent = item.name; select.appendChild(option); }); // Add event listeners select.addEventListener(‘change’, function() { if (this.selectedIndex > 0) { // If a specific industry is selected, use its pricing changeIndustry(this.options[this.selectedIndex].text); } else { // If “Select Your Industry” is chosen, use Option A as default baseline setDefaultPricing(); } }); // Function to set default Option A pricing function setDefaultPricing() { // Find the Option A pricing in the data array const defaultIndex = data.findIndex(item => item.option === ‘A’); if (defaultIndex !== -1) { const linksDiv = […document.querySelectorAll(‘.link’)]; linksDiv.forEach((link) => { const attr = link.getAttribute(‘data-attr’); const priceElem = link.querySelector(‘.link-price span’); const linkTotalPrice = link.querySelector(‘.link-total-price span’); const quantity = link.querySelector(‘.link-quantity’); // Set the price from Option A const price = data[defaultIndex][attr].price; priceElem.innerHTML = price; linkTotalPrice.innerHTML = Number(quantity.textContent) * price; }); // Recalculate total updateTotalCost(); } } // Function to update total cost based on current quantities and prices function updateTotalCost() { let totalCost = 0; const linksDiv = […document.querySelectorAll(‘.link’)]; linksDiv.forEach((link) => { const price = Number(link.querySelector(‘.link-price span’).textContent); const quantity = Number(link.querySelector(‘.link-quantity’).textContent); totalCost += price * quantity; }); document.querySelector(‘.summary-total-cost’).textContent = totalCost; } document.querySelectorAll(‘.link-quantity-btn-minus’).forEach(btn => { btn.addEventListener(‘click’, (ev) => { ev.preventDefault(); updateQuantity(ev.currentTarget, ‘minus’); }); }); document.querySelectorAll(‘.link-quantity-btn-plus’).forEach(btn => { btn.addEventListener(‘click’, (ev) => { ev.preventDefault(); updateQuantity(ev.currentTarget, ‘plus’); }); }); document.querySelector(‘.summary-order-btn’).addEventListener(‘click’, function() { // Check if industry is selected if (select.selectedIndex === 0) { document.querySelector(‘.summary-error’).textContent = “Please select an industry first”; document.querySelector(‘.summary-error’).classList.add(‘show’); return; } // Check if any links are selected if (!links.length) { document.querySelector(‘.summary-error’).textContent = “Please select at least one backlink”; document.querySelector(‘.summary-error’).classList.add(‘show’); return; } document.querySelector(‘.summary-error’).classList.remove(‘show’); // Build the new URL format let linksParam = ”; let salesDescription = ‘Backlinks Purchased – ‘; const descriptionParts = []; // Group links by DA value and count quantities const linkGroups = {}; links.forEach(link => { const daType = link.da; if (!linkGroups[daType]) { linkGroups[daType] = 0; } linkGroups[daType]++; }); // Build the links parameter and description parts for (const daType in linkGroups) { const quantity = linkGroups[daType]; const daLabel = daType.toUpperCase(); if (linksParam) { linksParam += ‘,’; } linksParam += `${quantity}:${daLabel}`; // Add to description parts descriptionParts.push(`(${quantity}) ${daLabel}`); } // Complete the sales description salesDescription += descriptionParts.join(‘, ‘) + ‘ One Time Charge’; // Get the total amount and ensure it has 2 decimal places const amount = parseFloat(document.querySelector(‘.summary-total-cost’).textContent).toFixed(2); // Get the selected industry name const selectedIndustry = select.options[select.selectedIndex].text; // Build the final URL const checkoutUrl = `https://webuildbacklinks.com/checkout/?links=${linksParam}&sales_description=${encodeURIComponent(salesDescription)}&quantity=1&link_type=Guest%20Post&key_words=3&amount=${amount}&product_id=0&industry=${encodeURIComponent(selectedIndustry)}`; // Redirect to the checkout URL window.location.href = checkoutUrl; }); // Initialize with Option A pricing as baseline setDefaultPricing(); }); ]]>