Referral Visit

const refCode = localStorage.getItem(“pending_referral”); fetch(“http://127.0.0.1:8000/auth/signup”, { method: “POST”, headers: { “Content-Type”: “application/json” }, body: JSON.stringify({ name, email, password, referral_code: refCode }) });Continue reading

Order Complete

const refCode = localStorage.getItem(“pending_referral”); fetch(“http://127.0.0.1:8000/auth/signup”, { method: “POST”, headers: { “Content-Type”: “application/json” }, body: JSON.stringify({ name, email, password, referral_code: refCode }) }); localStorage.removeItem(“pending_referral”);Continue reading

Enable Clean “Back” Button URL Reference

document.addEventListener(‘DOMContentLoaded’, function() { document.querySelectorAll(‘a[href=”#back-clean”]’).forEach(function(btn){ btn.addEventListener(‘click’, function(e){ e.preventDefault(); try { if (document.referrer) { var r = new URL(document.referrer); r.searchParams.delete(‘add-to-cart’); r.searchParams.delete(‘clear-cart’); // Add any additional parameters to ignore in new line window.location.href = r.toString(); } else { window.location.href = window.location.origin; } }…Continue reading

JS-snippet: knoppen toevoegen lesrooster en AJAX triggeren

jQuery(document).ready(function($){ var table = $(‘#tablepress-36’); if (!table.length) return; table.find(‘tbody tr’).each(function(index){ var row = $(this); var row_index = index + 1; // eerste rij header = 0 var button = $(‘‘, { text: ‘Geef je op’, class: ‘lesrooster-registreer-btn’, style: ‘margin-left:10px;padding:5px 10px;background:#0073aa;color:#fff;border:none;border-radius:3px;cursor:pointer;’…Continue reading

Canvas Capture JS

jQuery(function($) { console.log(‘🎨 Canvas capture active (optimized)’); var processing = false; var colorIndex = null; // Block other colors when opening preview $(document).on(‘mousedown touchstart’, ‘[data-live-preview-button-text]’, function(e) { if (processing) return false; processing = true; e.preventDefault(); e.stopPropagation(); e.stopImmediatePropagation(); var $btn =…Continue reading

SVG Tooltip

const tooltip = document.getElementById(“map-tooltip”); document.querySelectorAll(“.county”).forEach(path => { path.addEventListener(“mousemove”, e => { tooltip.textContent = path.dataset.tooltip; tooltip.style.left = e.pageX + “px”; tooltip.style.top = e.pageY + “px”; tooltip.style.opacity = 1; }); path.addEventListener(“mouseleave”, () => { tooltip.style.opacity = 0; }); });Continue reading

No Follow Social Links

document.addEventListener(‘DOMContentLoaded’, function() { // Selectors for ALL Social Links: // 1. .is-style-default a (For the global footer buttons) // 2. .social-stack-full a (For the specific buttons on Link Page) var socialLinks = document.querySelectorAll(‘.is-style-default a, .social-stack-full a’); socialLinks.forEach(function(link) { // Ensure…Continue reading

WooCommerce AJAX Fix for RD Theme Live Cart Update

const DEBUG = false; // Set to true to enable console logs for debugging (function checkJQueryThenRun(retries = 10) { if (typeof jQuery === ‘undefined’) { if (DEBUG) console.warn(‘⏳ Waiting for jQuery…’); if (retries > 0) { setTimeout(() => checkJQueryThenRun(retries –…Continue reading