' ); tab.document.close(); } /* ============================================================ SCROLL REVEAL ============================================================ */ function initScrollReveal() { if (!('IntersectionObserver' in window)) { var all = document.querySelectorAll('.kor-reveal'); for (var i = 0; i < all.length; i++) { all[i].classList.add('visible'); } return; } var observer = new IntersectionObserver(function(entries) { for (var j = 0; j < entries.length; j++) { if (entries[j].isIntersecting) { entries[j].target.classList.add('visible'); observer.unobserve(entries[j].target); } } }, { threshold: 0.1, rootMargin: '0px 0px -50px 0px' }); var els = document.querySelectorAll('.kor-reveal'); for (var k = 0; k < els.length; k++) { observer.observe(els[k]); } } /* ============================================================ WIRE IMAGE LIGHTBOX ============================================================ */ function wireImages(container) { korLightbox.images = []; /* Only wire content images, skip logos/header icons */ var imgs = container.querySelectorAll('.page-content img, .cover-image img, .kor-fallback-img img'); for (var i = 0; i < imgs.length; i++) { (function(img) { var src = img.getAttribute('src'); if (!src) return; var idx = korLightbox.images.length; korLightbox.images.push(img.src || src); img.style.cursor = 'pointer'; img.title = 'Clic para ampliar'; img.addEventListener('click', function() { openLightboxAt(idx); }); })(imgs[i]); } } /* ============================================================ BUILD HUMAN-READABLE DOC NAME ============================================================ */ function docHumanName(filename) { var base = filename.replace(/\.[^.]+$/, ''); var parts = base.split(/[-_]/); var filtered = []; for (var i = 0; i < parts.length; i++) { var p = parts[i].toLowerCase(); if (p === 'kor' || p === 'manual' || p === 'es' || p === 'en') continue; filtered.push(parts[i]); } if (filtered.length === 0) return base; return filtered.join(' ').replace(/\b\w/g, function(c) { return c.toUpperCase(); }); } function docCategory(filename) { var f = filename.toLowerCase(); if (f.indexOf('-kor') > -1 || f.indexOf('_kor') > -1 || f.indexOf('kor.') > -1) return 'FICHA TÉCNICA KOR'; if (f.indexOf('manual') > -1) return 'MANUAL'; if (f.indexOf('instala') > -1) return 'INSTALACIÓN'; if (f.indexOf('certificado') > -1 || f.indexOf('certif') > -1) return 'CERTIFICADO'; if (f.indexOf('esquema') > -1 || f.indexOf('diagram') > -1) return 'ESQUEMA'; return 'DOCUMENTO'; } function isKorFile(filename) { var f = filename.toLowerCase(); return (f.indexOf('-kor') > -1 || f.indexOf('_kor') > -1 || f.indexOf('kor.') > -1); } /* ============================================================ FILTER DOCUMENTS ============================================================ */ var DOC_EXCLUDE_PATTERNS = [ 'lista_precios', 'catalogo', 'catalog', '_en.pdf', 'error_code', 'fault_guide', 'ecodes', 'mobile_link', 'wifi', 'powerzone', 'interconnect', 'stamford', 'kb.json' ]; function normalizeStr(s) { return s.replace(/[_\-\s.]+/g, '').toLowerCase(); } function filterDocs(docs, itemCode, productName) { if (!docs || !docs.length) return []; var ic = (itemCode || '').toLowerCase(); var pn = (productName || '').toLowerCase(); var icNorm = normalizeStr(ic); var pnNorm = normalizeStr(pn); var filtered = []; for (var i = 0; i < docs.length; i++) { var d = docs[i]; var fname = (d.file_name || d.name || d.file_url || '').toLowerCase(); var fnameNorm = normalizeStr(fname); /* Step 1: exclude by pattern */ var skip = false; for (var j = 0; j < DOC_EXCLUDE_PATTERNS.length; j++) { if (fname.indexOf(DOC_EXCLUDE_PATTERNS[j]) > -1) { skip = true; break; } } if (skip) continue; /* Step 2: only keep docs relevant to THIS product */ var isRelevant = false; if (ic && fname.indexOf(ic) > -1) isRelevant = true; if (pnNorm && fnameNorm.indexOf(pnNorm) > -1) isRelevant = true; if (isRelevant) filtered.push(d); } /* Sort: KOR files first, then by name */ filtered.sort(function(a, b) { var aKor = isKorFile(a.file_name || a.name || a.file_url || ''); var bKor = isKorFile(b.file_name || b.name || b.file_url || ''); if (aKor && !bKor) return -1; if (!aKor && bKor) return 1; var aName = (a.file_name || a.name || '').toLowerCase(); var bName = (b.file_name || b.name || '').toLowerCase(); return aName.localeCompare(bName, 'es'); }); return filtered; } /* ============================================================ BUILD PRICING BOX HTML ============================================================ */ function buildPricingBox(product, pricing, dolarRates) { var html = '
'; html += '
'; html += '
'; html += '

PRECIO

'; html += '

' + esc(product.item_name || product.name || '') + '

'; if (pricing && pricing.price_usd) { var usd = parseFloat(pricing.price_usd) || 0; var iva = parseFloat(pricing.iva_pct || 21); var usdIva = usd * (1 + iva / 100); var moneda = (pricing.moneda_lista || '').toLowerCase(); var usaBlue = (moneda.indexOf('blue') > -1 || moneda.indexOf('billete') > -1); var dolarType = usaBlue ? 'Blue' : 'BNA Oficial'; var dolarVenta = 0; if (dolarRates && dolarRates.length) { for (var i = 0; i < dolarRates.length; i++) { var dr = dolarRates[i]; var casa = (dr.casa || dr.type || '').toLowerCase(); if (usaBlue && (casa.indexOf('blue') > -1)) { dolarVenta = parseFloat(dr.venta || dr.sell || 0); break; } if (!usaBlue && (casa.indexOf('oficial') > -1 || casa.indexOf('bna') > -1)) { dolarVenta = parseFloat(dr.venta || dr.sell || 0); break; } } } var arsTotal = dolarVenta > 0 ? (usdIva * dolarVenta) : 0; html += '
'; html += '
PRECIO SIN IVA
'; html += '
USD' + fmtNum(usd) + '
'; html += '
'; html += '
PRECIO CON IVA (' + Math.round(iva) + '%)
'; html += '
USD' + fmtNum(usdIva) + '
'; if (arsTotal > 0) { html += '
'; html += '
EQUIVALENTE EN ARS (CON IVA)
'; html += '
$ ' + fmtInt(arsTotal) + '
'; html += '
Dólar ' + esc(dolarType) + ': $' + fmtNum(dolarVenta) + '
'; } html += '
'; /* kor-price-card */ } else { html += '
Consultanos por precio actualizado
'; } html += '
'; /* kor-pricing-left */ html += '
'; html += '
Precio en dólares: Los precios están expresados en USD. El equivalente en ARS se calcula con la cotización del día, actualizada en tiempo real.
'; html += '
IVA incluido: El precio final con IVA es el monto que se emite en factura. Consulte condiciones de financiación.
'; html += ''; html += ' Consultar por WhatsApp'; html += ' Solicitar Cotización'; html += '
'; /* kor-pricing-right */ html += '
'; /* kor-pricing-inner */ html += '
'; return html; } /* ============================================================ BUILD DOCUMENTS SECTION HTML ============================================================ */ function buildDocsSection(itemCode, docs, productName) { return ''; var filtered = filterDocs(docs, itemCode, productName); var html = '
'; html += '
'; html += ''; html += '

Documentos & Descargas

'; html += '
'; if (!filtered.length) { html += '
No hay documentos disponibles para este modelo.
'; } else { html += '
'; for (var i = 0; i < filtered.length; i++) { var doc = filtered[i]; var fileUrl = doc.file_url || doc.url || '#'; var fileName = doc.file_name || doc.name || 'Documento'; var humanName = docHumanName(fileName); var cat = docCategory(fileName); var isKor = isKorFile(fileName); html += '
'; if (isKor) html += '
FICHA TÉCNICA
'; html += '
'; html += '
' + esc(humanName) + '
'; html += '
' + esc(cat) + '
'; html += '
'; html += ' Ver'; html += ' Descargar'; html += '
'; html += '
'; } html += '
'; /* kor-docs-grid */ } html += '
'; /* kor-docs-section */ return html; } /* ============================================================ BUILD KOR HEADER HTML ============================================================ */ function buildHeader(product) { var name = esc(product ? (product.item_name || product.name || '') : ''); return ( '
' + '
' + '
' + '' + '' + '' + '
' + '
' ); } /* ============================================================ BUILD BREADCRUMB ============================================================ */ function buildBreadcrumb(product) { var name = esc(product ? (product.item_name || product.name || 'Producto') : 'Producto'); return ( '
' + '
' + 'Inicio' + '' + 'Catálogo' + '' + '' + name + '' + '
' + '
' ); } /* ============================================================ BUILD KOR FOOTER HTML ============================================================ */ function buildFooter() { return ( '' ); } /* ============================================================ BUILD LIGHTBOX HTML ============================================================ */ function buildLightbox() { return ( '
' + '' + '' + '
Imagen ampliada
' + '' + '
1 / 1
' + '
' ); } /* ============================================================ BUILD WHATSAPP BUTTON ============================================================ */ function buildWhatsApp(product) { var msg = encodeURIComponent('Hola, quiero consultar por el ' + (product ? (product.item_name || product.name || 'generador') : 'generador')); return ''; } /* ============================================================ SEO: DYNAMIC META TAGS, CANONICAL, OPEN GRAPH ============================================================ */ function injectSeoMeta(product, pricing) { var name = product.item_name || product.web_item_name || product.name || ''; var brand = product.brand || 'Generac Argentina'; var desc = product.short_description || product.description || ''; if (!desc) desc = name + ' - Distribuidor oficial en Argentina. Consulte precio y disponibilidad.'; if (desc.length > 160) desc = desc.substring(0, 157) + '...'; var img = product.website_image || product.thumbnail || ''; var route = product.route || window.location.pathname.replace(/^\//, ''); var canonical = 'https://generac.net.ar/' + route; var fullImg = img ? (img.indexOf('http') === 0 ? img : 'https://generac.net.ar' + img) : 'https://generac.net.ar/files/SG200_main.jpg'; /* Remove old meta tags */ var oldMetas = document.querySelectorAll('meta[name="description"], meta[property^="og:"], meta[name^="twitter:"], link[rel="canonical"], meta[name="robots"]'); for (var i = 0; i < oldMetas.length; i++) { oldMetas[i].parentNode.removeChild(oldMetas[i]); } /* Title */ document.title = name + ' | Generac Argentina'; /* Meta tags */ var head = document.head; var metas = [ {name: 'description', content: desc}, {name: 'robots', content: 'index, follow, max-image-preview:large'}, {property: 'og:type', content: 'product'}, {property: 'og:title', content: name + ' | Generac Argentina'}, {property: 'og:description', content: desc}, {property: 'og:image', content: fullImg}, {property: 'og:url', content: canonical}, {property: 'og:site_name', content: 'Generac Argentina'}, {property: 'og:locale', content: 'es_AR'}, {property: 'product:brand', content: brand}, {name: 'twitter:card', content: 'summary_large_image'}, {name: 'twitter:title', content: name + ' | Generac Argentina'}, {name: 'twitter:description', content: desc}, {name: 'twitter:image', content: fullImg} ]; /* Add price OG tags if available */ if (pricing && pricing.price_usd) { metas.push({property: 'product:price:amount', content: String(pricing.price_usd)}); metas.push({property: 'product:price:currency', content: 'USD'}); metas.push({property: 'product:availability', content: 'in stock'}); } for (var m = 0; m < metas.length; m++) { var tag = document.createElement('meta'); if (metas[m].property) tag.setAttribute('property', metas[m].property); if (metas[m].name) tag.setAttribute('name', metas[m].name); tag.setAttribute('content', metas[m].content); head.appendChild(tag); } /* Canonical */ var link = document.createElement('link'); link.rel = 'canonical'; link.href = canonical; head.appendChild(link); } /* ============================================================ SEO: SCHEMA.ORG JSON-LD (Product, Organization, BreadcrumbList) ============================================================ */ function injectSchemaJsonLd(product, pricing) { var name = product.item_name || product.web_item_name || product.name || ''; var brand = product.brand || 'Generac Argentina'; var desc = product.short_description || product.description || (name + ' - Distribuidor oficial en Argentina.'); var img = product.website_image || product.thumbnail || ''; var route = product.route || window.location.pathname.replace(/^\//, ''); var canonical = 'https://generac.net.ar/' + route; var fullImg = img ? (img.indexOf('http') === 0 ? img : 'https://generac.net.ar' + img) : ''; var itemGroup = product.item_group || ''; /* 1. Organization schema */ var orgSchema = { '@context': 'https://schema.org', '@type': 'Organization', 'name': 'Generac Argentina', 'alternateName': 'Generadores KOR', 'url': 'https://generac.net.ar', 'logo': 'https://generac.net.ar/files/SG200_main.jpg', 'contactPoint': { '@type': 'ContactPoint', 'telephone': '+54-11-3956-3099', 'contactType': 'sales', 'areaServed': 'AR', 'availableLanguage': 'Spanish' }, 'address': { '@type': 'PostalAddress', 'addressCountry': 'AR' }, 'sameAs': [ 'https://www.instagram.com/generac.net.ar', 'https://wa.me/5491139563099' ] }; /* 2. BreadcrumbList schema */ var breadcrumbSchema = { '@context': 'https://schema.org', '@type': 'BreadcrumbList', 'itemListElement': [ {'@type': 'ListItem', 'position': 1, 'name': 'Inicio', 'item': 'https://generac.net.ar/'}, {'@type': 'ListItem', 'position': 2, 'name': 'Catálogo', 'item': 'https://generac.net.ar/shop'} ] }; if (itemGroup) { breadcrumbSchema.itemListElement.push({ '@type': 'ListItem', 'position': 3, 'name': itemGroup, 'item': 'https://generac.net.ar/shop?item_group=' + encodeURIComponent(itemGroup) }); breadcrumbSchema.itemListElement.push({'@type': 'ListItem', 'position': 4, 'name': name}); } else { breadcrumbSchema.itemListElement.push({'@type': 'ListItem', 'position': 3, 'name': name}); } /* 3. Product schema */ var productSchema = { '@context': 'https://schema.org', '@type': 'Product', 'name': name, 'description': desc, 'brand': {'@type': 'Brand', 'name': brand}, 'manufacturer': {'@type': 'Organization', 'name': brand}, 'sku': product.item_code || '', 'url': canonical, 'category': itemGroup }; if (fullImg) productSchema.image = fullImg; /* Add pricing offers */ if (pricing && pricing.price_usd) { var usd = parseFloat(pricing.price_usd) || 0; productSchema.offers = { '@type': 'Offer', 'url': canonical, 'priceCurrency': 'USD', 'price': usd.toFixed(2), 'priceValidUntil': new Date(Date.now() + 30 * 86400000).toISOString().split('T')[0], 'availability': 'https://schema.org/InStock', 'seller': {'@type': 'Organization', 'name': 'Generac Argentina'}, 'itemCondition': 'https://schema.org/NewCondition' }; } else { productSchema.offers = { '@type': 'Offer', 'url': canonical, 'availability': 'https://schema.org/InStock', 'seller': {'@type': 'Organization', 'name': 'Generac Argentina'}, 'itemCondition': 'https://schema.org/NewCondition' }; } /* Inject all schemas */ var schemas = [orgSchema, breadcrumbSchema, productSchema]; for (var s = 0; s < schemas.length; s++) { var script = document.createElement('script'); script.type = 'application/ld+json'; script.textContent = JSON.stringify(schemas[s]); document.head.appendChild(script); } } /* ============================================================ FAQ SECTION (dynamic per product type) ============================================================ */ function buildFaqSection(product) { var ig = (product.item_group || '').toLowerCase(); var name = product.item_name || product.web_item_name || product.name || 'este producto'; var faqs = []; /* Generic FAQs */ faqs.push({q: '\u00bfRealizan env\u00edos a todo el pa\u00eds?', a: 'S\u00ed, realizamos env\u00edos a toda Argentina. El costo y tiempo de entrega depende de la ubicaci\u00f3n. Consultenos por WhatsApp o email para una cotizaci\u00f3n con env\u00edo incluido.'}); faqs.push({q: '\u00bfLos precios incluyen IVA?', a: 'Los precios publicados son en d\u00f3lares sin IVA. El precio final con IVA se muestra autom\u00e1ticamente en la ficha del producto, junto con su equivalente en pesos argentinos actualizado al d\u00eda.'}); /* Generator-specific */ if (ig.indexOf('gas') > -1 || ig.indexOf('diesel') > -1 || ig.indexOf('silent') > -1 || ig.indexOf('inverter') > -1 || ig.indexOf('nafta') > -1 || ig.indexOf('generador') > -1) { faqs.push({q: '\u00bfQu\u00e9 diferencia hay entre un generador a gas y uno diesel?', a: 'Los generadores a gas natural son ideales para uso residencial permanente: son m\u00e1s silenciosos, requieren menos mantenimiento y se conectan a la red de gas. Los diesel son m\u00e1s robustos, eficientes en consumo para uso prolongado y se recomiendan para aplicaciones comerciales e industriales.'}); faqs.push({q: '\u00bfNecesito instalaci\u00f3n especial?', a: 'S\u00ed, la instalaci\u00f3n debe ser realizada por un gasista y electricista matriculado. Incluye la conexi\u00f3n al tablero de transferencia, ventilaci\u00f3n adecuada y cumplimiento de normativas locales. Podemos asesorarlo con instaladores en su zona.'}); faqs.push({q: '\u00bfCu\u00e1nto combustible consume por hora?', a: 'El consumo var\u00eda seg\u00fan el modelo y la carga aplicada. En general, un generador a gas consume entre 1 y 4 m\u00b3/h, mientras que uno diesel consume entre 2 y 15 litros/hora. Consulte la ficha t\u00e9cnica del modelo espec\u00edfico para datos exactos.'}); faqs.push({q: '\u00bfIncluye tablero de transferencia autom\u00e1tica?', a: 'Depende del modelo. Algunos incluyen ATS (transferencia autom\u00e1tica) integrado. Para los que no, ofrecemos tableros de transferencia compatibles como accesorio.'}); } /* TTA */ if (ig.indexOf('tablero') > -1 || ig.indexOf('transferencia') > -1) { faqs.push({q: '\u00bfQu\u00e9 es un tablero de transferencia autom\u00e1tica?', a: 'Es un dispositivo que monitorea la red el\u00e9ctrica y, ante un corte de energ\u00eda, arranca autom\u00e1ticamente el generador y transfiere la carga. Cuando la red se restablece, retorna la alimentaci\u00f3n a la red y apaga el generador.'}); faqs.push({q: '\u00bfEs compatible con cualquier generador?', a: 'Cada tablero est\u00e1 dimensionado para una potencia espec\u00edfica. Es fundamental elegir uno que coincida con la capacidad de su generador. Consulte con nuestro equipo para asegurar la compatibilidad.'}); faqs.push({q: '\u00bfRequiere mantenimiento el tablero?', a: 'El mantenimiento es m\u00ednimo. Se recomienda una revisi\u00f3n anual de contactores, bornes y protecciones. Los tableros con PLC pueden requerir actualizaci\u00f3n de firmware ocasional.'}); } /* Solar */ if (ig.indexOf('solar') > -1 || ig.indexOf('energia') > -1) { faqs.push({q: '\u00bfC\u00f3mo funciona un sistema de energ\u00eda solar?', a: 'Los paneles solares captan la energ\u00eda del sol y la convierten en electricidad. Un inversor transforma esa energ\u00eda de corriente continua (DC) a corriente alterna (AC) para alimentar su hogar o negocio. Las bater\u00edas almacenan el excedente para usar durante la noche.'}); faqs.push({q: '\u00bfCu\u00e1ntos paneles necesito?', a: 'Depende de su consumo el\u00e9ctrico mensual. Un hogar promedio en Argentina consume entre 300-500 kWh/mes, lo que requiere entre 6-12 paneles de 550W. Contactenos para un dimensionamiento personalizado gratuito.'}); faqs.push({q: '\u00bfPuedo inyectar energ\u00eda a la red?', a: 'S\u00ed, con un inversor on-grid o h\u00edbrido y el medidor bidireccional correspondiente. La regulaci\u00f3n var\u00eda seg\u00fan la provincia. Nuestros equipos son compatibles con la modalidad de generaci\u00f3n distribuida.'}); } /* Torres */ if (ig.indexOf('torre') > -1 || ig.indexOf('iluminacion') > -1) { faqs.push({q: '\u00bfQu\u00e9 \u00e1rea ilumina una torre?', a: 'Depende del modelo y la altura del m\u00e1stil. Las torres V5+ iluminan hasta 4.000 m\u00b2 y las V7+ hasta 5.500 m\u00b2. Son ideales para obras, eventos, estacionamientos y emergencias.'}); faqs.push({q: '\u00bfCu\u00e1ntas horas de autonom\u00eda tiene?', a: 'Con tanque lleno, las torres Atlas Copco ofrecen entre 80 y 200 horas de autonom\u00eda seg\u00fan el modelo y modo de iluminaci\u00f3n (LED o hal\u00f3genas).'}); } /* Closing FAQs */ faqs.push({q: '\u00bfOfrecen financiaci\u00f3n?', a: 'S\u00ed, ofrecemos distintas opciones de pago: transferencia bancaria, dep\u00f3sito, y financiaci\u00f3n en cuotas seg\u00fan el monto. Contactenos para conocer las condiciones vigentes.'}); faqs.push({q: '\u00bfTienen servicio t\u00e9cnico y repuestos?', a: 'S\u00ed, contamos con servicio t\u00e9cnico especializado y stock de repuestos para todas las marcas que comercializamos. Realizamos mantenimiento preventivo y correctivo.'}); /* Build HTML */ var html = '
'; html += '
'; html += '
'; html += ''; html += '

Preguntas Frecuentes

'; html += '
'; html += '
'; for (var i = 0; i < faqs.length; i++) { html += '
'; html += '
' + esc(faqs[i].q) + '
'; html += '

' + esc(faqs[i].a) + '

'; html += '
'; } html += '
'; html += '
'; html += '
'; /* Also inject FAQ Schema.org JSON-LD */ var faqSchema = { '@context': 'https://schema.org', '@type': 'FAQPage', 'mainEntity': [] }; for (var j = 0; j < faqs.length; j++) { faqSchema.mainEntity.push({ '@type': 'Question', 'name': faqs[j].q, 'acceptedAnswer': {'@type': 'Answer', 'text': faqs[j].a} }); } var faqScript = document.createElement('script'); faqScript.type = 'application/ld+json'; faqScript.textContent = JSON.stringify(faqSchema); document.head.appendChild(faqScript); return html; } /* ============================================================ BUILD FALLBACK PAGE (no KOR HTML available) ============================================================ */ function buildFallbackPage(product, pricing, dolarRates, docs) { var name = esc(product.item_name || product.name || 'Generador'); var brand = esc(product.brand || ''); var shortDesc = esc(product.short_description || ''); var fullDesc = product.description || ''; var imgSrc = product.thumbnail || product.website_image || ''; var html = '
'; html += '
'; /* Image column */ html += '
'; if (imgSrc) { html += '' + name + ''; } else { html += '
Imagen no disponible
'; } html += '
'; /* Info column */ html += '
'; if (brand) html += '
' + brand + '
'; html += '

' + name + '

'; if (shortDesc) html += '

' + shortDesc + '

'; if (fullDesc) html += '
' + fullDesc + '
'; html += '
'; html += '
'; /* grid */ html += '
'; /* kor-fallback */ if (imgSrc) { korLightbox.images = [imgSrc]; } return html; } /* ============================================================ PROCESS KOR BROCHURE HTML ============================================================ */ function processKorHtml(korHtml, product, pricing, dolarRates, docs) { var parser = new DOMParser(); var doc = parser.parseFromString(korHtml, 'text/html'); var body = doc.body; if (!body) return null; /* ── Extract and inject KOR brochure's own CSS ── */ var korStyles = doc.querySelectorAll('style'); if (korStyles.length > 0) { var rawCss = ''; for (var si = 0; si < korStyles.length; si++) { rawCss += korStyles[si].textContent + '\n'; } /* Strip global resets and print media that would leak */ rawCss = rawCss.replace(/@media\s+print\s*\{[\s\S]*?\}\s*\}/g, ''); rawCss = rawCss.replace(/\*\s*\{[^}]*\}/g, ''); rawCss = rawCss.replace(/:root\s*\{[^}]*\}/g, ''); rawCss = rawCss.replace(/\bbody\s*\{[^}]*\}/g, ''); /* Inject into page — these selectors (.page, .cover, etc.) only exist inside #kor-brochure-body so no global leaks */ var styleEl = document.createElement('style'); styleEl.id = 'kor-brochure-native-css'; styleEl.textContent = rawCss; var oldStyle = document.getElementById('kor-brochure-native-css'); if (oldStyle) oldStyle.remove(); document.head.appendChild(styleEl); } /* ── Clean up body content ── */ /* Remove all page-footer and page-header elements (page numbers) */ var footers = body.querySelectorAll('.page-footer'); for (var f = 0; f < footers.length; f++) { footers[f].remove(); } var pageHeaders = body.querySelectorAll('.page-header'); for (var ph = 0; ph < pageHeaders.length; ph++) { pageHeaders[ph].remove(); } /* Remove back-cover page (we have our own footer) */ var backCovers = body.querySelectorAll('.back-cover, .page.back-cover, .page.contraportada'); for (var bc = 0; bc < backCovers.length; bc++) { backCovers[bc].remove(); } /* Add kor-reveal to each page section */ var pages = body.querySelectorAll('.page'); for (var p = 0; p < pages.length; p++) { pages[p].classList.add('kor-reveal'); } return body.innerHTML; } /* ============================================================ INJECT PRICING AFTER COVER ============================================================ */ function injectPricingAfterCover(container, pricingHtml) { var cover = container.querySelector('.page.cover, .cover'); if (cover) { var pricingEl = document.createElement('div'); pricingEl.innerHTML = pricingHtml; var node = pricingEl.firstElementChild || pricingEl.firstChild; if (node && cover.parentNode) { cover.parentNode.insertBefore(node, cover.nextSibling); } } else { /* Inject at the top if no cover found */ var pricingEl2 = document.createElement('div'); pricingEl2.innerHTML = pricingHtml; var n2 = pricingEl2.firstElementChild || pricingEl2.firstChild; if (n2) container.insertBefore(n2, container.firstChild); } } /* ============================================================ MAIN RENDER FUNCTION ============================================================ */ function renderPage(product, pricing, dolarRates, docs, korHtml) { console.log('[KOR PDP] renderPage called, korHtml length:', korHtml ? korHtml.length : 0, 'pricing:', !!pricing); /* SEO: Inject dynamic meta tags, canonical, Open Graph */ injectSeoMeta(product, pricing); /* SEO: Inject Schema.org JSON-LD (Product, Organization, BreadcrumbList) */ injectSchemaJsonLd(product, pricing); /* Hide ALL original ERPNext page content */ var hideSelectors = '.page_content, main, .page-content-wrapper, .container, .product-container, .product-details-section, .product-page-content, .website-post-content, .navbar, .web-footer, footer'; var toHide = document.querySelectorAll(hideSelectors); for (var c = 0; c < toHide.length; c++) { toHide[c].style.display = 'none'; } /* Create root wrapper */ var root = document.createElement('div'); root.id = 'kor-pdp-root'; document.body.appendChild(root); /* Header */ root.innerHTML = buildHeader(product); /* Breadcrumb */ root.innerHTML += buildBreadcrumb(product); /* Main brochure body */ var mainBody = document.createElement('div'); mainBody.id = 'kor-brochure-body'; var itemCode = product.item_code || product.name || ''; var productName = (product.web_item_name || product.item_name || product.route || '').toLowerCase(); if (korHtml && korHtml.length > 100) { /* Process and inject KOR brochure content */ var processedHtml = processKorHtml(korHtml, product, pricing, dolarRates, docs); if (processedHtml) { mainBody.innerHTML = processedHtml; /* Inject pricing section after cover */ var pricingHtml = buildPricingBox(product, pricing, dolarRates); injectPricingAfterCover(mainBody, pricingHtml); /* Inject documents section at the end */ var docsHtml = buildDocsSection(itemCode, docs, productName); var docsWrap = document.createElement('div'); docsWrap.innerHTML = docsHtml; var docsNode = docsWrap.firstElementChild || docsWrap; mainBody.appendChild(docsNode); } else { mainBody.innerHTML = buildFallbackPage(product, pricing, dolarRates, docs); mainBody.innerHTML += buildPricingBox(product, pricing, dolarRates); mainBody.innerHTML += buildDocsSection(itemCode, docs, productName); } } else { /* Fallback: no KOR HTML available */ var fbHtml = buildFallbackPage(product, pricing, dolarRates, docs); fbHtml += buildPricingBox(product, pricing, dolarRates); fbHtml += buildDocsSection(itemCode, docs, productName); mainBody.innerHTML = fbHtml; } root.appendChild(mainBody); /* FAQ Section (before footer) */ var faqDiv = document.createElement('div'); faqDiv.innerHTML = buildFaqSection(product); var faqNode = faqDiv.firstElementChild || faqDiv; root.appendChild(faqNode); /* Footer */ var footerDiv = document.createElement('div'); footerDiv.innerHTML = buildFooter(); root.appendChild(footerDiv.firstElementChild || footerDiv); /* Lightbox */ var lbDiv = document.createElement('div'); lbDiv.innerHTML = buildLightbox(); root.appendChild(lbDiv.firstElementChild || lbDiv); /* WhatsApp float */ var waDiv = document.createElement('div'); waDiv.innerHTML = buildWhatsApp(product); root.appendChild(waDiv.firstElementChild || waDiv); /* Wire images */ wireImages(mainBody); /* "Imagen figurativa" overlay for TTA / transfer switch products */ (function() { var ic = (product.item_code || '').toUpperCase(); var ig = (product.item_group || '').toLowerCase(); var isTTA = ic.indexOf('TTA') > -1 || ic.indexOf('LTTA') > -1 || ic.indexOf('MONOFASICA') > -1 || ic.indexOf('TRIFASICA') > -1 || ig.indexOf('tablero') > -1 || ig.indexOf('transferencia') > -1; if (isTTA) { var targets = mainBody.querySelectorAll('.cover-image, .kor-fallback-img'); for (var t = 0; t < targets.length; t++) { var el = targets[t]; if (el.querySelector('img')) { var badge = document.createElement('div'); badge.className = 'kor-img-figurativa'; badge.innerHTML = 'Imagen figurativa \u2013 El producto real puede variar'; el.appendChild(badge); } } } })(); /* Lightbox keyboard handler */ document.addEventListener('keydown', function(e) { var lb = document.getElementById('kor-lb'); if (!lb || !lb.classList.contains('open')) return; if (e.key === 'Escape') closeLightbox(); if (e.key === 'ArrowLeft') lightboxNav(-1); if (e.key === 'ArrowRight') lightboxNav(1); }); /* Close lightbox on backdrop click */ var lbEl = document.getElementById('kor-lb'); if (lbEl) { lbEl.addEventListener('click', function(e) { if (e.target === lbEl) closeLightbox(); }); } /* Init scroll reveal with small delay for DOM paint */ setTimeout(function() { initScrollReveal(); }, 80); /* Analytics: Track product view (GA4 + Meta Pixel) */ try { var pName = product.item_name || product.web_item_name || product.name || ''; var pBrand = product.brand || ''; var pCategory = product.item_group || ''; var pPrice = (pricing && pricing.price_usd) ? parseFloat(pricing.price_usd) : 0; /* GA4 view_item event */ if (typeof gtag === 'function') { gtag('event', 'view_item', { currency: 'USD', value: pPrice, items: [{ item_id: product.item_code || '', item_name: pName, item_brand: pBrand, item_category: pCategory, price: pPrice }] }); } /* Meta Pixel ViewContent event */ if (typeof fbq === 'function') { fbq('track', 'ViewContent', { content_name: pName, content_category: pCategory, content_ids: [product.item_code || ''], content_type: 'product', value: pPrice, currency: 'USD' }); } } catch(e) { console.log('[KOR PDP] Analytics error:', e); } } /* ============================================================ LOADING SCREEN ============================================================ */ function showLoader() { var allContent = document.querySelectorAll('body > *:not(style):not(link):not(script)'); for (var i = 0; i < allContent.length; i++) { if (!allContent[i].id || allContent[i].id.indexOf('kor') === -1) { allContent[i].style.display = 'none'; } } var loader = document.createElement('div'); loader.id = 'kor-initial-loader'; loader.className = 'kor-loader'; loader.innerHTML = '
Cargando producto…
'; document.body.appendChild(loader); } function hideLoader() { var loader = document.getElementById('kor-initial-loader'); if (loader) loader.parentNode.removeChild(loader); } /* ============================================================ DATA FETCHING ============================================================ */ function fetchJson(url) { return fetch(url, { headers: { 'Accept': 'application/json' } }).then(function(r) { if (!r.ok) throw new Error('HTTP ' + r.status); return r.json(); }); } function fetchText(url) { return fetch(url).then(function(r) { if (!r.ok) throw new Error('HTTP ' + r.status); return r.text(); }); } function safePromise(p, fallback) { return p.then(function(v) { return v; }).catch(function() { return fallback; }); } /* ============================================================ INIT ============================================================ */ function init() { /* Only run on product pages */ if (!document.body || !document.body.classList.contains('product-page')) return; showLoader(); /* Step 1: Get page route */ var path = document.body.getAttribute('data-path') || window.location.pathname.replace(/^\//, ''); /* Step 2: Fetch Website Item */ var mainFilters = JSON.stringify([['route', '=', path]]); var mainFields = JSON.stringify(['*']); var webItemUrl = '/api/resource/Website%20Item?filters=' + encodeURIComponent(mainFilters) + '&fields=' + encodeURIComponent(mainFields) + '&limit_page_length=1'; safePromise(fetchJson(webItemUrl), null).then(function(webItemResp) { var product = {}; if (webItemResp && webItemResp.data && webItemResp.data.length) { product = webItemResp.data[0]; } else { /* Fallback: extract from DOM */ product = getExistingData(); } var itemCode = product.item_code || product.name || ''; /* Step 3: Parallel fetches */ var pricingPromise = itemCode ? safePromise(fetchJson('/api/method/get_item_pricing?item_code=' + encodeURIComponent(itemCode)), null) : Promise.resolve(null); var dolarPromise = safePromise(fetchJson('https://dolarapi.com/v1/dolares'), []); var docsPromise = itemCode ? safePromise(fetchJson('/api/method/get_item_documents?item_code=' + encodeURIComponent(itemCode)), []) : Promise.resolve([]); var korHtmlPromise = itemCode ? safePromise(fetchText('/files/' + encodeURIComponent(itemCode) + '-KOR.html'), '') : Promise.resolve(''); Promise.all([pricingPromise, dolarPromise, docsPromise, korHtmlPromise]).then(function(results) { var pricing = results[0]; var dolarRates = results[1]; var docsRaw = results[2]; var korHtml = results[3] || ''; /* Normalize pricing */ if (pricing && pricing.message) pricing = pricing.message; else if (pricing && pricing.data) pricing = pricing.data; /* Normalize docs */ var docs = []; if (docsRaw) { if (docsRaw.message && Array.isArray(docsRaw.message)) docs = docsRaw.message; else if (Array.isArray(docsRaw)) docs = docsRaw; else if (docsRaw.data && Array.isArray(docsRaw.data)) docs = docsRaw.data; } /* Normalize dolar rates */ if (dolarRates && dolarRates.message) dolarRates = dolarRates.message; if (!Array.isArray(dolarRates)) dolarRates = []; hideLoader(); renderPage(product, pricing, dolarRates, docs, korHtml); }).catch(function(err) { hideLoader(); renderPage(product, null, [], [], ''); }); }).catch(function() { var product = getExistingData(); hideLoader(); renderPage(product, null, [], [], ''); }); } /* ============================================================ PUBLIC API ============================================================ */ window.korPDP = { openLightbox: openLightboxAt, closeLightbox: closeLightbox, lightboxNav: lightboxNav, openPdf: openPdfViewer }; /* ============================================================ WAIT FOR DOM READY ============================================================ */ if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', init); } else { init(); } })();
Vista Principal Vista Hero Presentación Motor Dimensiones Tablero TTA Controller Mantenimiento
Generac SG200

Generadores Gas Código del Producto: GENERAC-RG027

$ 20.710,00 ($ 20.710,00 / Nos)
Out of stock
Generac SG200 — Generador Comercial a Gas

El Generac SG200 es un generador comercial de 27 kVA a gas natural o GLP, con motor de 4 cilindros en línea refrigerado por líquido de 2.4L. Diseñado para funcionamiento continuo a 1500 RPM, ofrece la confiabilidad que tu negocio necesita.

Características Principales
  • Motor 2.4L Refrigerado por Líquido: 4 cilindros en línea, más silencioso y duradero que motores enfriados por aire
  • TruePower: THD menor a 5%, energía limpia para equipos sensibles
  • MobileLink WiFi: Monitoreo y control remoto incluido de fábrica
  • Evolution Controller LCD: Panel multilenguaje con diagnósticos avanzados
  • Gabinete RhinoCoat: Aluminio con acabado resistente a corrosión e intemperie
  • Quiet-Test: Ejercicio semanal silencioso para mantener el equipo en óptimas condiciones
  • Conexión Mono + Trifásica: Versatilidad para instalaciones comerciales 220/380V
¿Cómo Funciona?
  1. Se corta la luz — El sistema detecta la falla de red
  2. Arranque automático — Con TTA compatible (RTS 100A, se vende por separado)
  3. Transferencia de energía — En menos de 10 segundos tu negocio vuelve a tener electricidad
  4. Retorno automático — Cuando vuelve la red, el equipo re-transfiere y se apaga solo
Especificaciones Técnicas EléctricoMotorCombustible + Garantía
Potencia nominal27 kVA / 25 kW
Tensión monofásica110-220 V
Tensión trifásica231/400 V
Frecuencia50 Hz
Factor de potencia0,8
Regulación tensión±1%
THD<5%
ConexiónMono + Tri
ModeloGenerac 2.4L
Tipo4 cil. en línea
Cilindrada2.4 L
Velocidad1.500 RPM
RefrigeraciónLíquida
Aceite3,8 L
ArranqueEléctrico
Quiet-Test
CombustibleGas Nat. / GLP
Consumo GN @100%10,2 m³/h
Consumo GLP @100%14,8 L/h
Consumo GN @50%5,6 m³/h
GabineteAluminio RhinoCoat
ControllerEvolution LCD
Garantía3 años
WiFiMobile Link
Soporte24/7 Generac
Largo158 cm
Alto85 cm
Profundidad74 cm
Peso456 kg
Nivel de ruido62-75 dB(A)
Temperatura-20 a +50 °C

Aplicaciones: Comercios, PyMEs, oficinas, clínicas, edificios, barrios cerrados, industria liviana

Customer Reviews

0

0 ratings
0 out of 5
1 star
0%
2 star
0%
3 star
0%
4 star
0%
5 star
0%
No Reviews