From 8ca8d57bb42f3d1be9de7a88dac2ff5a63f4f0d1 Mon Sep 17 00:00:00 2001 From: marsalva Date: Sun, 17 May 2026 20:37:11 +0000 Subject: [PATCH] Actualizar index.html --- index.html | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/index.html b/index.html index 3d565ff..e123cb7 100644 --- a/index.html +++ b/index.html @@ -89,8 +89,9 @@
Plan Protección Eléctrica @@ -413,7 +414,7 @@ } function openProtectionPlan() { - window.location.href = `plan-tranquilidad.html?token=${urlToken}`; + window.location.href = `https://portal.integrarepara.es/publi.html`; } function closeProtectionBanner() { @@ -429,12 +430,20 @@ function closeProtectionBanner() { function initProtectionBanner(subscription) { const banner = document.getElementById('promo-banner'); + const bannerImg = document.getElementById('promoBannerImg'); if (!banner) return; - const wasClosed = localStorage.getItem(`promo_closed_${urlToken}`) === 'true'; - const isPlanPage = window.location.pathname.includes('plan-tranquilidad'); + // Si la empresa subió una imagen desde configuración, la aplicamos + const customAd = globalCompanyData?.company_ad || globalCompanyData?.ad; + if (customAd && bannerImg) { + bannerImg.src = customAd; + } - if (!subscription && !wasClosed && !isPlanPage) { + const wasClosed = localStorage.getItem(`promo_closed_${urlToken}`) === 'true'; + const isPlanPage = window.location.pathname.includes('publi.html'); + + // Mostramos el banner si no lo ha cerrado manualmente + if (!wasClosed && !isPlanPage) { banner.classList.remove('hidden'); } else { banner.classList.add('hidden');