diff --git a/index.html b/index.html index 3d565ff..e123cb7 100644 --- a/index.html +++ b/index.html @@ -89,8 +89,9 @@
@@ -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');