window.allProducts = [ ]; var materials = [], sizes = [], finishObjects = [], finishs = []; hardwares = [], strainers =[], currents = [], types = ['Bass Drum', 'Snare Drum', 'Tom']; function makePrototype(title, type, id, productHandle, hardware, strainer, finish, image, price, compare) { var protoType = {}; var sizeVar, sizeSplit, sizeStr, sizeFixed; protoType.type = type; protoType.type = type.replace('Custom ', ''); if (title.toLowerCase().indexOf('mahogany') > 0) { protoType.material = 'mahogany' } else if (title.toLowerCase().indexOf('aluminum') > 0) { protoType.material = 'aluminum' } else { protoType.material = 'maple' } protoType.variantId = id; protoType.productHandle = productHandle; protoType.hardware = hardware; protoType.strainer = strainer; protoType.finish = finish; protoType.image = image; protoType.price = price; protoType.compare = compare; sizeSplit = title.split('″'); sizeFixed = sizeSplit[0] + '″' + sizeSplit[1] + '″'; if (!sizes.includes(sizeFixed)) { sizes.push(sizeFixed) } protoType.size = sizeFixed; if (!materials.includes(protoType.material)) { materials.push(protoType.material); } if (!hardwares.includes(protoType.hardware) ) { hardwares.push(protoType.hardware); } if (!strainers.includes(protoType.strainer) && protoType.strainer !== '') { strainers.push(protoType.strainer); } if (!finishs.includes(protoType.finish)) { var finishObj = {}; finishObj.fancy = protoType.finish; finishObj.simple = protoType.finish.toLowerCase().replace(' ', '-').replace("'", ''); finishObj.finish = protoType.finish; finishObjects.push(finishObj); finishs.push(protoType.finish); } window.allProducts.push(protoType); }