/* Add custom JS code below */ // change copyright text (for meta verification) const copyrightParagraph = document.querySelector('.copyrights p'); copyrightParagraph.textContent = "جميع الحقوق محفوظة © لـ مؤسسة سمبوستنا لتقديم الوجبات"; // change the cart icon function updateCartIcon() { // Uses the flexible 'ends with' rule from Reason 2 const carticon = document.querySelector('a[href\$="/cart"]'); if (carticon) { carticon.innerHTML = `
٠

٠

`; console.log("Successfully updated the cart icon!"); } else { // If not found, try searching again in 100ms setTimeout(updateCartIcon, 100); } } // Kick off the selector check loop updateCartIcon(); // modify the cart icon for the bottom navbar for mobile document.addEventListener("DOMContentLoaded", function () { // 1. Target the Salla cart component container const cartSummary = document.querySelector('.bottom-header-cart salla-cart-summary'); if (cartSummary) { // 2. Hide the heavy inline SVG icon if it exists const svgIcon = cartSummary.querySelector('.s-cart-summary-icon'); if (svgIcon) { svgIcon.style.display = 'none'; } // 3. Target Salla's fallback slot icon wrapper const slotIconDiv = cartSummary.querySelector('[slot="icon"]'); if (slotIconDiv) { // Find the interior icon class and change it to sicon-cart2 const interiorIcon = slotIconDiv.querySelector('i'); if (interiorIcon) { interiorIcon.className = ''; // Reset old classes interiorIcon.classList.add('sicon-cart2', 'text-xl', 'text-black'); } // 4. Check if the "السلة" text label is already there; if not, add it if (!slotIconDiv.querySelector('.cart-text-label')) { const label = document.createElement('span'); label.className = 'cart-text-label'; label.innerText = 'السلة'; slotIconDiv.appendChild(label); } } } });