/* soar-products-en-v4.js - English version for /en/products/ (page 38159) - 2026-11-21. Base: v5c. lang=en filter + USD (ceil CNY/6) + EN category mapping. */ var CAT_DATA=[{"id":1266,"name":"Laser Components","slug":"laser-accessories","count":2449,"children":[{"id":4075,"name":"Thorlabs Optomechanical Components","slug":"thorlabs-optomechanical-components","count":245,"children":[]},{"id":4029,"name":"Thorlabs Achromatic Lenses","slug":"thorlabs%e6%b6%88%e8%89%b2%e5%b7%ae%e9%80%8f%e9%95%9c","count":157,"children":[]},{"id":4043,"name":"Thorlabs Cylindrical Lenses","slug":"thorlabs%e5%9c%86%e6%9f%b1%e5%bd%a2%e9%80%8f%e9%95%9c","count":118,"children":[]},{"id":4037,"name":"Thorlabs Axicons","slug":"axicon","count":114,"children":[]},{"id":4024,"name":"Thorlabs Ball Lenses","slug":"thorlabs%e7%90%83%e9%80%8f%e9%95%9c","count":106,"children":[]},{"id":4030,"name":"Thorlabs Air-Spaced Doublets","slug":"thorlabs%e7%a9%ba%e6%b0%94%e9%9a%99%e5%8f%8c%e5%90%88%e9%80%8f%e9%95%9c","count":97,"children":[]},{"id":4028,"name":"Thorlabs Aspheric Lenses","slug":"thorlabs%e9%9d%9e%e7%90%83%e9%9d%a2%e9%80%8f%e9%95%9c","count":94,"children":[]},{"id":4106,"name":"Thorlabs Iris Diaphragms","slug":"thorlabs-iris-diaphragms","count":74,"children":[]},{"id":4038,"name":"Thorlabs Optical Systems","slug":"optical-systems","count":15,"children":[]},{"id":4039,"name":"Thorlabs Singlet Kits","slug":"singlet-kit","count":26,"children":[]},{"id":4054,"name":"Thorlabs Crystalline Supermirrors","slug":"thorlabs-crystalline-supermirrors","count":13,"children":[]},{"id":4108,"name":"Thorlabs Polaris Product Line","slug":"thorlabs-polaris","count":13,"children":[]},{"id":4042,"name":"Thorlabs Lens Tutorial","slug":"lens-tutorial","count":12,"children":[]},{"id":4055,"name":"Thorlabs Tunable Lenses","slug":"thorlabs-tunable-lenses","count":8,"children":[]},{"id":4040,"name":"Thorlabs Microlens Arrays","slug":"microlens-array","count":6,"children":[]},{"id":4041,"name":"Thorlabs PMMA Microlenses","slug":"pmma-microlens","count":6,"children":[]}]},{"id":3188,"name":"Laser Sources","slug":"laser-source","count":290,"children":[]},{"id":3187,"name":"Galvo Scanners","slug":"galvo-scanner","count":110,"children":[]},{"id":3181,"name":"Chillers","slug":"chiller","count":87,"children":[]},{"id":2749,"name":"F-Theta Lenses","slug":"field-lens","count":64,"children":[]},{"id":3183,"name":"Cutting Heads","slug":"cutting-head","count":63,"children":[]},{"id":3008,"name":"CO2 Lasers","slug":"co2%e6%bf%80%e5%85%89%e5%99%a8","count":103,"children":[]},{"id":4053,"name":"Bessel Cutting Heads","slug":"bessel-cutting-head","count":82,"children":[]},{"id":2703,"name":"GENTEC-EO Laser Power Meters","slug":"gentec-eo%e6%bf%80%e5%85%89%e5%8a%9f%e7%8e%87%e8%ae%a1","count":174,"children":[]},{"id":27,"name":"Laser Power Meters","slug":"laser-power-meter","count":138,"children":[]},{"id":3174,"name":"Optical Components","slug":"optical-components","count":73,"children":[{"id":4019,"name":"Optical Mirrors","slug":"optical-mirrors","count":73,"children":[]}]},{"id":2932,"name":"Photodetectors","slug":"photodetector","count":182,"children":[{"id":4416,"name":"Amplified Detectors","slug":"","count":34,"children":[]},{"id":4411,"name":"Photodiodes","slug":"photodiodes","count":31,"children":[]},{"id":4412,"name":"Mounted Photodiodes","slug":"","count":17,"children":[]},{"id":4418,"name":"Balanced Detectors","slug":"","count":17,"children":[]},{"id":4417,"name":"Biased Detectors","slug":"","count":15,"children":[]},{"id":4415,"name":"Thermopile Detectors","slug":"","count":9,"children":[]},{"id":4419,"name":"Pyroelectric Detectors","slug":"","count":10,"children":[]},{"id":4414,"name":"Photovoltaic Detectors","slug":"","count":5,"children":[]},{"id":4413,"name":"Calibrated Photodiodes","slug":"","count":4,"children":[]},{"id":4422,"name":"Avalanche Photodiodes (APD)","slug":"avalanche-detectors","count":40,"children":[]},{"id":5178,"name":"Photomultiplier Tubes (PMT)","slug":"%e5%85%89%e7%94%b5%e5%80%8d%e5%a2%9e%e7%ae%a1pmt","count":25,"children":[]}]},{"id":1759,"name":"Reflectors","slug":"f-theta-lens","count":25,"children":[]},{"id":3185,"name":"Desktop Laser Markers","slug":"desktop-laser-marker","count":18,"children":[]},{"id":3909,"name":"Optical Choppers","slug":"optical-chopper","count":17,"children":[{"id":3911,"name":"Chopper Blades","slug":"chopper-blades","count":15,"children":[]},{"id":3910,"name":"Optical Chopper Systems","slug":"optical-chopper-system","count":2,"children":[]}]},{"id":1765,"name":"Laser Welding Machines","slug":"laser-welding-machine","count":13,"children":[]},{"id":3173,"name":"Galvo Scanning Systems","slug":"galvo-scanning-system","count":13,"children":[]},{"id":35,"name":"Beam Expanders","slug":"beam-expander","count":12,"children":[]},{"id":3281,"name":"DIAMOND J Series","slug":"diamond-j-series","count":10,"children":[]},{"id":3179,"name":"Flying Laser Coders","slug":"flying-coder","count":10,"children":[]},{"id":3184,"name":"Portable Laser Markers","slug":"portable-laser-marker","count":10,"children":[]},{"id":2702,"name":"GENTEC-EO Laser Energy Meters","slug":"gentec-eo%e6%bf%80%e5%85%89%e8%83%bd%e9%87%8f%e8%ae%a1","count":9,"children":[]},{"id":3235,"name":"DIAMOND C Series","slug":"diamond-c-series","count":12,"children":[]},{"id":3236,"name":"DIAMOND Cx Series","slug":"diamond-cx-series","count":8,"children":[]},{"id":3186,"name":"Pneumatic Markers","slug":"pneumatic-marker","count":7,"children":[]},{"id":3003,"name":"Picosecond Lasers","slug":"%e7%9a%ae%e7%a7%92%e6%bf%80%e5%85%89%e5%99%a8","count":11,"children":[{"id":3004,"name":"Ultraviolet (UV) Lasers","slug":"%e7%b4%ab%e5%a4%96%e6%bf%80%e5%85%89%e5%99%a8","count":11,"children":[]}]},{"id":4315,"name":"CO2 Laser Power Supplies","slug":"co2%e6%bf%80%e5%85%89%e7%94%b5%e6%ba%90","count":21,"children":[]},{"id":2894,"name":"Laser Viewing Cards","slug":"diao-guang-pian","count":8,"children":[]},{"id":1766,"name":"Laser Cutting Machines","slug":"laser-cutting-machine","count":4,"children":[]},{"id":3182,"name":"Laser Power Supplies","slug":"laser-power-supply","count":3,"children":[]},{"id":3912,"name":"Optical Power Meters","slug":"optical-power-meter","count":5,"children":[]},{"id":5815,"name":"Ophir Laser Measurement","slug":"ophir%e6%bf%80%e5%85%89%e6%b5%8b%e9%87%8f","count":391,"children":[{"id":5820,"name":"Ophir Accessories","slug":"ophir%e9%85%8d%e4%bb%b6","count":155,"children":[]},{"id":5822,"name":"Ophir Beam Profilers","slug":"ophir%e5%85%89%e6%9d%9f%e5%88%86%e6%9e%90%e4%bb%aa","count":71,"children":[]},{"id":5816,"name":"Ophir Power Meters","slug":"ophir%e5%8a%9f%e7%8e%87%e8%ae%a1","count":39,"children":[]},{"id":5818,"name":"Ophir Energy Sensors","slug":"ophir%e8%83%bd%e9%87%8f%e4%bc%a0%e6%84%9f%e5%99%a8","count":39,"children":[]},{"id":5819,"name":"Ophir Cables","slug":"ophir%e7%94%b5%e7%bc%86","count":29,"children":[]}]},{"id":4438,"name":"Huaray Lasers","slug":"huaray-laser","count":106,"children":[{"id":4439,"name":"Nanosecond Lasers","slug":"huaray-nanosecond","count":44,"children":[]},{"id":4441,"name":"Femtosecond Lasers","slug":"huaray-femtosecond","count":36,"children":[]},{"id":4440,"name":"Picosecond Lasers","slug":"huaray-picosecond","count":23,"children":[]}]},{"id":5852,"name":"Sill Optics","slug":"sill-optics","count":137,"children":[]},{"id":4446,"name":"Fiber Lasers","slug":"%e5%85%89%e7%ba%a4%e6%bf%80%e5%85%89%e5%99%a8","count":64,"children":[]},{"id":5221,"name":"Beam Characterization","slug":"beam-characterization","count":168,"children":[]},{"id":4105,"name":"Thorlabs Optical Rails & Systems","slug":"thorlabs-optical-rails","count":372,"children":[]},{"id":4109,"name":"Thorlabs Compact Optomechanics","slug":"thorlabs-compact-optomechanics","count":169,"children":[]},{"id":3927,"name":"Thorlabs Galvo Scanning Systems","slug":"thorlabs-galvo-scanner","count":187,"children":[]},{"id":4103,"name":"Thorlabs 30mm Cage Systems","slug":"thorlabs-30mm-cage-system","count":131,"children":[]},{"id":4102,"name":"Thorlabs 16mm Cage Systems","slug":"thorlabs-16mm-cage-system","count":57,"children":[]},{"id":4114,"name":"Thorlabs OEM Optomechanics","slug":"thorlabs-oem-optomechanics","count":58,"children":[]},{"id":5881,"name":"Thorlabs Optical Tables","slug":"thorlabs-optical-tables","count":80,"children":[]},{"id":5830,"name":"Linear Translation Stages","slug":"linear-translation-stages","count":451,"children":[]},{"id":20,"name":"Pulsed Fiber Lasers","slug":"pulsed-fiber-lasers","count":56,"children":[]},{"id":4370,"name":"Excelitas PCO Cameras","slug":"excelitas-pco%e7%9b%b8%e6%9c%ba","count":54,"children":[]},{"id":1799,"name":"Solid-State Lasers","slug":"solid-state-lasers","count":36,"children":[]},{"id":1800,"name":"Semiconductor Lasers","slug":"semiconductor-lasers","count":18,"children":[]},{"id":5859,"name":"Wavemeters & Spectrometers","slug":"wavemeters-and-spectrometers","count":21,"children":[]}]; var KW_DATA={"Laser":500,"Laser Source":511,"Thorlabs":479,"Fiber Optic":353,"Mirror":432,"Lens":300,"Gentec-EO":217,"Filter":200,"Cage System":160,"Mount":150,"Welding":149,"Mounting Base":120,"Galvo":118,"Power Meter":102,"Focus Lens":90,"Chiller":86,"Marking Machine":83,"Bessel":82,"JPT":80,"Protective Window":80,"ND Filter":80,"UV":80,"Cutting Nozzle":70,"Detector":67,"Semiconductor":66,"F-Theta Lens":66,"Cutting Head":63,"Cleaning":61,"Raycus":61,"Collimator":60,"Dichroic Mirror":60,"Plane Mirror":60,"Water Cooling":60,"Beamsplitter":50,"Welding Head":50,"CW Laser":50,"Silicon Mirror":50,"Handheld":51,"Photodetection":49,"1064nm":45,"Scan Head":40,"Scanlab":39,"MOPA":35,"Beam Expander":35,"532nm":30,"Red Laser":30,"CO2":134,"QCW":21,"Portable":20,"Chopper":17,"Desktop":12,"Pneumatic":7,"3D Printing":4,"IPG":2,"Flying Coding":2,"Nozzle":1,"Huaray":107,"Femtosecond Laser":53,"Picosecond Laser":43,"Nanosecond Laser":37,"Ophir":391,"Sill Optics":137,"Fiber Laser":64,"UV Laser":80,"Translation Stage":451,"Optical Rail":372,"Integrating Sphere":38,"Wavemeter":21,"Spectrometer":21,"Camera":54,"Wavefront Sensor":30,"Laser Head":50,"Collimation":60,"Temperature Control":53,"Polarization":40}; var _soarCurrentMode='all'; var _soarCurrentParam=''; var _soarCurrentPage=1; var _soarPerPage=60; var SOAR_CATS=CAT_DATA; var SOAR_PINNED=[{id:3011,name:"Laser Combiners"},{id:5920,name:"Single-Mode Lasers"},{id:5921,name:"Narrow-Linewidth Lasers"},{id:1798,name:"Ultrafast Lasers"}]; var EN_TERMS={}; var SOAR_ALL_TOTAL=0; var ZH_SLUG={}; function soarDecodeSlug(s){ if(!s)return ''; try{return decodeURIComponent(s).toLowerCase();}catch(e){return String(s).toLowerCase();} } function soarIndexZhSlugs(){ function walk(arr){ for(var i=0;i=100&&page<10){page++;step();}else{cb();} }; xhr.onerror=function(){cb();}; xhr.send(); }; step(); } function soarCatParam(id){ var k=ZH_SLUG[id]; if(k&&EN_TERMS[k])return {param:String(EN_TERMS[k].id),count:EN_TERMS[k].count}; return {param:'',count:0}; } function soarBuildTree(all){ var byId={},roots=[]; all.forEach(function(c){byId[c.id]={id:c.id,name:c.name,count:c.count,children:[]};}); all.forEach(function(c){var n=byId[c.id];if(c.parent&&byId[c.parent]){byId[c.parent].children.push(n);}}); all.forEach(function(c){if(!c.parent){roots.push(byId[c.id]);}}); function prune(list){ return list.filter(function(n){ n.children=prune(n.children); return n.count>0||n.children.length>0; }); } roots=prune(roots); roots.sort(function(a,b){return b.count-a.count;}); roots.forEach(function(n){n.children.sort(function(a,b){return b.count-a.count;});}); return roots; } function soarFetchCategories(){ var acc=[],page=1,maxPage=6,done=false; function finish(){ if(done)return;done=true; if(!acc.length)return; var cleaned=acc.filter(function(c){return c.count>0&&c.id!==15;}); var tree=soarBuildTree(cleaned); if(tree.length){SOAR_CATS=tree;} soarRenderCategories(); var allCountEl=document.getElementById("soar-all-count"); if(allCountEl&&allCountEl.textContent==="-"){soarUpdateAllCount();} } function step(){ var xhr=new XMLHttpRequest(); xhr.open("GET","https://www.soar-laser.cn/wp-json/wp/v2/product_cat?per_page=100&page="+page+"&orderby=count&order=desc&hide_empty=false",true); xhr.onload=function(){ if(xhr.status===200){ var batch=JSON.parse(xhr.responseText); if(batch&&batch.length){ acc=acc.concat(batch); if(batch.length===100&&page'; html+='
  • Featured Series
    '; for(var p=0;p'+SOAR_PINNED[p].name+''; } html+='
  • '; for(var i=0;i0; html+='
  • '; html+='
    '; var cpr=soarCatParam(cat.id); html+='
    '+cat.name+(cpr.param?''+cpr.count+'':'')+'
    '; if(hasCh){html+='+';} html+='
    '; if(hasCh){ html+='
    '; for(var j=0;j'+ch[j].name+(hpr.param?' ('+hpr.count+')':'')+'
    '; } html+=''; } html+='
  • '; } list.innerHTML=html; soarBindCatEvents(); soarBindToggleEvents(); } function soarBindToggleEvents(){ document.querySelectorAll(".soar-cat-toggle").forEach(function(el){ el.addEventListener("click",function(e){ e.stopPropagation(); var box=document.getElementById(this.dataset.target); if(!box)return; var open=box.classList.toggle("show"); this.textContent=open?"\u2212":"+"; }); }); } function soarBindCatEvents(){ document.querySelectorAll('.soar-cat-item,.soar-cat-child').forEach(function(el){ el.addEventListener('click',function(){ document.querySelectorAll('.soar-cat-item.active').forEach(function(a){a.classList.remove('active');}); this.classList.add('active'); var mode=this.dataset.mode; var param=this.dataset.param; var title=(this.dataset.catname||this.textContent.replace(/\s*\d+$/,'')).trim(); document.getElementById('soar-current-title').textContent=title; if(mode==='category'&&!param){ document.getElementById('soar-products-container').innerHTML='
    No English listings in this category yet. Please contact us for a quotation.
    '; var rc=document.getElementById('soar-result-count'); if(rc)rc.textContent='(0 products)'; return; } soarLoadProducts(mode,param,1); }); }); } function soarRenderKW(){ var cloud=document.getElementById("soar-kw-cloud"); if(!cloud)return; var colors=['#4a6cf7','#ff6b6b','#52c41a','#faad14','#722ed1','#13c2c2','#2f54eb','#eb2f96']; var maxK=Math.max(...Object.values(KW_DATA)); var html=''; for(var k in KW_DATA){ var s=KW_DATA[k]/maxK; var fs=12+Math.round(s*10); var c=colors[Math.floor(Math.random()*colors.length)]; var href='/en/products/?kw='+encodeURIComponent(k); html+=''+k+''; } cloud.innerHTML=html; soarBindKWEvents(); } function soarBindKWEvents(){ document.querySelectorAll('.soar-kw-tag').forEach(function(el){ el.addEventListener('click',function(e){ e.preventDefault(); document.querySelectorAll('.soar-kw-tag.active').forEach(function(a){a.classList.remove('active');}); this.classList.add('active'); var kw=this.textContent; document.getElementById('soar-current-title').textContent='Keyword: '+kw; soarLoadProducts('keyword',kw,1); }); }); } function soarLoadProducts(){ var mode=arguments.length>0?arguments[0]:'all'; var param=arguments.length>1?arguments[1]:''; var page=arguments.length>2?arguments[2]:1; _soarCurrentMode=mode; _soarCurrentParam=param; _soarCurrentPage=page; var url='https://www.soar-laser.cn/wp-json/wc/v3/products?per_page='+_soarPerPage+'&page='+page+'&lang=en&consumer_key=ck_ff67a858ea0872726036014a99e7417aea7bcaab&consumer_secret=cs_c86a46185e32573a24e71ddd83ee4f62da88c6f7'; if(mode==='category')url+='&category='+param; if(mode==='brand')url+='&tag='+param; if(mode==='keyword')url+='&search='+encodeURIComponent(param); document.getElementById('soar-products-container').innerHTML='

    Loading...

    '; var xhr=new XMLHttpRequest(); xhr.open('GET',url,true); xhr.onload=function(){ if(xhr.status===200){ var products=JSON.parse(xhr.responseText); var total=parseInt(xhr.getResponseHeader('X-WP-Total'))||products.length; var totalPages=parseInt(xhr.getResponseHeader('X-WP-TotalPages'))||1; if(mode==='all'){SOAR_ALL_TOTAL=total;var _ac=document.getElementById('soar-all-count');if(_ac)_ac.textContent=total;} soarRenderProducts(products); soarUpdateCount(total); soarRenderPagination(page,totalPages); if(mode==='all'){ var allCountEl=document.getElementById('soar-all-count'); if(allCountEl)allCountEl.textContent=total; } var container=document.getElementById('soar-products-container'); if(container)container.scrollIntoView({behavior:'smooth',block:'start'}); }else{ document.getElementById('soar-products-container').innerHTML='

    Failed to load. Please refresh and retry

    '; } }; xhr.onerror=function(){ document.getElementById('soar-products-container').innerHTML='

    Network error

    '; }; xhr.send(); } function soarRenderProducts(products){ var container=document.getElementById('soar-products-container'); if(!products||products.length===0){ container.innerHTML='

    No matching products found

    '; return; } var html='
    '; products.forEach(function(p){ var img=(p.images?p.images.length:0)>0?''+p.name+'':'
    No image
    '; var _usd=p.price?Math.ceil(parseFloat(p.price)/6):0; var price=_usd>0?('$'+_usd.toLocaleString('en-US')+''):'Price on request'; var ahref=p.permalink||('#product='+p.id); html+='
    '+img+'

    '+p.name+'

    '+price+'
    '; }); html+='
    '; container.innerHTML=html; } function soarUpdateCount(total){ var countEl=document.getElementById('soar-result-count'); if(countEl)countEl.textContent=('('+total+' products)'); } function soarRenderPagination(currentPage,totalPages){ var pagEl=document.getElementById('soar-pagination'); if(!pagEl||totalPages<=1){if(pagEl)pagEl.innerHTML='';return;} var html=''; html+=''; var pages=[]; var start=Math.max(1,currentPage-2); var end=Math.min(totalPages,currentPage+2); if(start>1){pages.push(1);if(start>2)pages.push('...');} for(var i=start;i<=end;i++)pages.push(i); if(end'+p+''; } }); html+=''; pagEl.innerHTML=html; pagEl.querySelectorAll('.soar-page-btn:not(.disabled)').forEach(function(btn){ btn.addEventListener('click',function(){ var p=parseInt(this.dataset.page); if(p>=1){if(p<=totalPages){if(p!==_soarCurrentPage){ soarLoadProducts(_soarCurrentMode,_soarCurrentParam,p); } }}}); }); } document.addEventListener('DOMContentLoaded',function(){ soarIndexZhSlugs(); soarRenderCategories(); soarRenderKW(); soarLoadProducts('all','',1); soarLoadEnTerms(function(){ soarRenderCategories(); }); var params=new URLSearchParams(window.location.search); var kw=params.get('kw'); if(kw){ document.querySelectorAll('.soar-kw-tag').forEach(function(el){ if(el.textContent===kw){ el.classList.add('active'); document.getElementById('soar-current-title').textContent='Keyword: '+kw; soarLoadProducts('keyword',kw,1); } }); } }); /* v5c: grid layout fix (self-injected) */ (function(){ var css=".soar-products-grid{grid-template-columns:repeat(auto-fill,minmax(185px,1fr))!important;gap:14px!important;}" +".soar-product-card img{height:172px!important;object-fit:contain!important;background:#fff;padding:6px;}" +"@media(max-width:1200px){.soar-products-grid{grid-template-columns:repeat(4,1fr)!important;}}" +"@media(max-width:900px){.soar-products-grid{grid-template-columns:repeat(3,1fr)!important;}}" +"@media(max-width:600px){.soar-products-grid{grid-template-columns:repeat(2,1fr)!important;gap:8px!important;}}"; function inject(){ if(document.getElementById("soar-grid-fix"))return; var st=document.createElement("style"); st.id="soar-grid-fix"; st.textContent=css; (document.head||document.documentElement).appendChild(st); } if(document.readyState==="loading"){document.addEventListener("DOMContentLoaded",inject);}else{inject();} })();