'; console.log(promoHeader); $(promoHeader).insertBefore(".LpContainer"); } if(promosArr.indexOf(nkey)>-1){ for (var keyid in obj) { if (!obj.hasOwnProperty(keyid)) continue; itemobj = obj[keyid]; nkeyid=Number(keyid); if(keyid!==featuredPromoId && itemobj.inventory > 0 && prexist[keyid]==undefined){ brandsObj[itemobj.brand]=itemobj.brandId; catsObj[itemobj.category]=itemobj.categoryId; listingScore=itemobj.score; if(featuredPromo!==undefined){ if (featuredPromo==itemobj.id) { listingScore=100; } } reviewhtml=generateStars(itemobj.rating,itemobj.rating_count); msrp=+itemobj.msrp; if(msrp>0){ msrp='$'+msrp; }else{ msrp=''; } shortDesc=itemobj.description; pp=itemobj.price; price2=pp.toFixed(2); desc=shortDesc.replace(/&bull;/g,'•').replace(/<br \/>/g,'').replace(/"/g,'"'); content+='
'+itemobj.category+''+itemobj.brand+' '+itemobj.subtitle+''+desc+''+reviewhtml+'$'+price2+''+msrp+'Add to Cart w/ Sound...'+promoItemValue+'
'; reviewhtml=''; prexist[keyid]=obj.pairedId; } } if(promosArr.length==it){content+='';} it++; } } brandsArr=Object.keys(brandsObj); for (var i = brandsArr.length - 1; i >= 0; i--) { brandsList+=''+brandsArr[i]+''; } catsArr=Object.keys(catsObj); for (var i = catsArr.length - 1; i >= 0; i--) { catsList+=''+catsArr[i]+''; } filterContent='
Shop By Size
'+catsList+'
'; content='
'+content; $("#productRow").prepend(content+'
'); $("#filterRow").html(filterContent); $("#bulletPoints").html(htmldetails); $("#sortContainer").mixItUp({ load: { sort: 'score:desc', },callbacks: { onMixEnd: function (state) { } } }); $(".sorttrigger").click(function () { $(this).parent().toggleClass("closed"); }); $(".toTop").click(function () { $('html').scrollTop(0); }); })(jQuery);