Description
NATIONAL CYCLE WS,VSTREAM,FMR,CL,TALL,KAW VERSYS-X 300 (N20126)
Fitment Lookup
SELECT BRANDSELECT MODELSELECT YEAR
Fitments:
Select Brand, Model, and Year To Check Fitment For CurrentProduct
Disclaimer: Fitment information is based on third-party data andmay not be accurate. Other fitments may be available but are not showndue to limited data. Verify with your vehicle’s manufacturer or aprofessional before making any changes. We are not responsible forerrors or actions taken based on this information.const fitments = [{“m”:”KLE300 Versys-X”,”b”:0,”y”:{“2”:{“-1”:[“N20126|”]},”6″:{“-1”:[“N20126|”]}}},{“m”:”KLE300 Versys-X ABS”,”b”:0,”y”:{“0”:{“-1”:[“N20126|”]},”1″:{“-1”:[“N20126|”]},”3″:{“-1”:[“N20126|”]},”4″:{“-1”:[“N20126|”]},”5″:{“-1”:[“N20126|”]}}}]const brands = [“KAWASAKI”]const notes = []const years = [2019,2020,2023,2017,2018,2021,2022]const options = []const brandSelector = document.getElementById(‘FITMENT_BRAND’)const modelSelector = document.getElementById(‘FITMENT_MODEL’)const yearSelector = document.getElementById(‘FITMENT_YEAR’)const form = document.getElementById(‘FITMENT_FORM’)const table = document.getElementById(‘FITMENT_TABLE’)const notesDiv = document.getElementById(‘FITMENT_NOTES’)const _sBrands = […brands].sort((a, b) => (a > b ? 1 : a {if (!_sModels.includes(fitment.m)) {_sModels.push(fitment.m)const option = document.createElement(‘option’)option.innerHTML = fitment.moption.value = fitment.moption.title = fitment.moption.hidden = truemodelSelector.appendChild(option)}})_sBrands.forEach((brand) => {const option = document.createElement(‘option’)option.innerHTML = brandoption.value = brandoption.title = brandconst foundIndex = brands.findIndex((_brand) => brand === _brand)option.dataset[‘index’] = foundIndexbrandSelector.appendChild(option)})_sYears.forEach((year) => {const option = document.createElement(‘option’)option.innerHTML = yearoption.value = yearoption.hidden = trueoption.title = yearconst foundIndex = years.findIndex((_year) => year === _year)option.dataset[‘index’] = foundIndexyearSelector.appendChild(option)})_sBrands.splice(0, _sBrands.length)_sModels.splice(0, _sModels.length)_sYears.splice(0, _sYears.length)let currentBrandlet currentModellet currentYearconst resetState = (state) => {if (state === ‘all’) {modelSelector.value = ‘default’modelSelector.disabled = falsecurrentModel = undefined}yearSelector.value = ‘default’yearSelector.disabled = truecurrentYear = undefinedcleanMessages()createMessage(‘Select Brand, Model, and Year To Find Fitment For Product’)cleanFitmentTable()}const updateModels = () => {const newFitmentLookup = fitments.filter((fitment) => {return fitment.b === currentBrand})modelSelector.querySelectorAll(‘option’)?.forEach((option, index) => {if (index === 0 || option.innerHTML.trim() === ‘SELECT MODEL’) returnoption.remove()})newFitmentLookup.forEach((fitment) => {const option = document.createElement(‘option’)option.style.wordBreak = ”option.innerHTML = fitment.moption.value = fitment.moption.title = fitment.mmodelSelector.appendChild(option)})resetState(‘all’)}const updateYears = () => {const newFitment = fitments.find((fitment) => {return fitment.b === currentBrand && fitment.m === currentModel})yearSelector.querySelectorAll(‘option’)?.forEach((option) => {const foundYear = newFitment.y[option.dataset[‘index’]]if (foundYear) {option.hidden = false} else {option.hidden = true}})resetState()yearSelector.disabled = false}const createMessage = (text, note) => {const span = document.createElement(‘span’)span.innerHTML = textspan.style.marginTop = ‘0.5rem’span.style.marginBottom = ‘0.5rem’if (note) {span.style.fontWeight = ‘bold’span.style.fontStyle = ‘italic’}notesDiv.appendChild(span)}const cleanMessages = () => {const messages = notesDiv.querySelectorAll(‘span’)messages.forEach((message) => message.remove())}const cleanFitmentTable = () => {const rows = table.querySelectorAll(‘tr’)rows.forEach((row) => row.remove())}const createFitmentHeaders = () => {const row = document.createElement(‘tr’)table.appendChild(row)const tableHeader = document.createElement(‘th’)tableHeader.innerHTML = ‘SKU | OPTION(s)’row.appendChild(tableHeader)}const createFitmentRow = (text) => {const row = document.createElement(‘tr’)table.appendChild(row)const tableHeader = document.createElement(‘td’)tableHeader.innerHTML = textrow.appendChild(tableHeader)}const showFitments = () => {const fitment = fitments.find((fitment) => fitment.b === currentBrand && fitment.m === currentModel)?.y?.[currentYear]cleanFitmentTable()if (!fitment) {cleanMessages()createMessage(‘No Fitments Found For This Current Product’)return}cleanMessages()createFitmentHeaders()const currentNotes = []const currentFitments = []for (noteKey in fitment) {const note = notes[noteKey]let notePositionif (note) notePosition = currentNotes.push(note)fitment[noteKey].sort((a, b) => (a > b ? 1 : a {const manufacturerSKU = sku.split(‘|’)[0]const optionString = options?.[sku.split(‘|’)?.[1]]const text = notePosition? `${manufacturerSKU}${‘*’.repeat(notePosition)}${optionString ? ` | ${optionString}` : ”}`: `${manufacturerSKU}${optionString ? ` | ${optionString}` : ”}`createFitmentRow(text)})}currentNotes.forEach((note, index) => {createMessage(`${‘*’.repeat(index + 1)} ${note}`, true)})}form.addEventListener(‘change’, (event) => {switch (event.target.id) {case ‘FITMENT_BRAND’:currentBrand = Number(event.target.options[event.target.selectedIndex]?.dataset[‘index’])brandSelector.title = brands[currentBrand]updateModels()breakcase ‘FITMENT_MODEL’:currentModel = event.target.valuemodelSelector.title = event.target.valueupdateYears()breakcase ‘FITMENT_YEAR’:currentYear = Number(event.target.options[event.target.selectedIndex]?.dataset[‘index’])yearSelector.title = years[currentYear]showFitments()breakdefault:console.error(‘ERROR’)}})
Explore more from our collection.




Reviews
There are no reviews yet.