Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.33 KB | None | 0 0
  1. javascript:var keyObj=[],skuObj={skuList:[]},combinedSkuKey=[];$(".product").each(function(s){thisKey=$(this).data("source-info").split(",")[3].split(":")[1],thisSku=$(this).data("source-info").split(",")[2].split(":")[1],""==thisKey&&(thisKey="key1"),keyObj.push(thisKey),skuObj.skuList.push(thisSku),$(this).addClass(thisSku+thisKey)}),sendDataOBJ=JSON.stringify(skuObj),$(".productSwatches").css("margin-top","30px"),$.ajax({url:"/services/stockservices.asmx/GetProductVariantStock",type:"POST",contentType:"application/json; charset=utf-8",data:sendDataOBJ,success:function(s,t){var e,i;for(stockList=$.parseJSON(s.d),e=0;e<keyObj.length;e++)searchID=skuObj.skuList[e]+keyObj[e],$.each(stockList.stocklist,function(s,t){if(currentID=t.prodId,-1==$.inArray(currentID,combinedSkuKey)&&searchID==currentID)for(i=0;i<this.sizesInStock.length;i++)0==this.sizesInStock[i].stlev&&""==this.sizesInStock[i].preOrderAvailable?thiscol="red":0==this.sizesInStock[i].stlev&&""!=this.sizesInStock[i].preOrderAvailable?thiscol="orange":thiscol="green",combinedSkuKey.push(searchID),$("."+searchID+" .productSwatches").append(" &nbsp;&nbsp; <span style='font-size:16px'><strong>"+this.sizesInStock[i].value1+"</strong>:<span style='color:"+thiscol+"'>"+this.sizesInStock[i].stlev+"</span></span> ")})},error:function(){alert("Error loading Lookbook data (stock JSON 2).")}});
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement