(function() { // server finds and replaces: // HASHTAG{env} with our environment string // HASHTAG{storeHash} with our store hash // HASHTAG{bcContainerClass} with our store container (if we are using class) // HASHTAG{bcContainerId} with our store container (if we are using an ID) var env = 'p'; var storeHash = 'x2bt0ycptv'; var bcContainerId = ''; var bcContainerClass = 'part-finder-inner'; var bcDisplayType = 'horizontal'; var bcSearchPage = ''; var bcModelSearch = ''; var showCategory = ''; // console.log('PC Fitment: environment', env); // console.log('PC Fitment: installed for store', storeHash); // console.log('PC Fitment: container ID', bcContainerId); // console.log('PC Fitment: container class', bcContainerClass); // console.log('PC Fitment: Display Type', bcDisplayType); // console.log('PC Fitment: bcDisplayType: '+bcDisplayType); console.log('PC Fitment: showCategory: '+showCategory); // env // var DEV_BASE_URL = ' https://pcbctechapp.ngrok.io'; var DEV_BASE_URL = 'https://bcomexapi.omexinfotech.com'; var PROD_BASE_URL = 'https://bc.partsconnect.co'; var host; switch (env) { case 'd': host = DEV_BASE_URL; break; case 'p': default: host = PROD_BASE_URL; break; } // container // load css var css_name ='/static/h_main.css'; if(bcDisplayType == 'vertical'){ css_name ='/static/v_main.css'; } var head = document.getElementsByTagName('head')[0]; var link = document.createElement('link'); link.id = 'pc-fitment-bigcommerce-css'; link.rel = 'stylesheet'; link.type = 'text/css'; link.href = host + ''+css_name; link.media = 'all'; head.appendChild(link); // create container for dropdowns inside either bcContainerClass or bcContainerId var outer; if (bcContainerId !== '') outer = document.getElementById(bcContainerId); if (!outer && bcContainerClass !== '') outer = document.getElementsByClassName(bcContainerClass)[0]; var inner = document.createElement('div'); inner.id = 'pc-fitment-bigcommerce-container'; inner.setAttribute('data-env', env); inner.setAttribute('data-storehash', storeHash); outer.appendChild(inner); outer.style.position = 'relative'; //outer.style.zIndex = 2147483646; // outer.style.margin = '5%'; // we have to make sure our header is still on top -- special case for specific themes var header = document.getElementsByClassName('site-header')[0]; if (header) { header.style.position = 'absolute'; header.style.zIndex = 2147483647; } // load dropdowns var dd = document.createElement('script'); dd.type = 'text/javascript'; dd.async = true; dd.src = host + '/static/main.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(dd, s); if(bcSearchPage !=''){ var dd = document.createElement('script'); dd.type = 'text/javascript'; dd.async = true; dd.src = host + '/static/pc_buyer_guide.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(dd, s); } //hide unwanted option from search by model page var currenturl = window.location.href; if(bcModelSearch != '' && currenturl.indexOf(bcModelSearch) >= 0 ) { //hide no result found message var noProduct = document.getElementsByClassName("no-products"); var npIndex; for (npIndex = 0; npIndex < noProduct.length; npIndex++) { noProduct[npIndex].style.display = "none"; } //hide no sort by dropdown from the model search page var soryByDropDown = document.getElementsByClassName("actionBar"); var sbIndex; for (sbIndex = 0; sbIndex < soryByDropDown.length; sbIndex++) { soryByDropDown[sbIndex].style.display = "none"; } //hide no sort by dropdown from the model search page var Breadcrumb = document.getElementsByClassName("breadcrumb"); var bdIndex; for (bdIndex = 0; bdIndex < Breadcrumb.length; bdIndex++) { Breadcrumb[bdIndex].style.display = "none"; } } })();