"+n[i].attributeName+"<\/td> | "+(n[i].CustomValue!=null?n[i].CustomValue:n[i].Name)+"<\/td><\/tr>")}function addModels(n,t){console.log(n,t);let r="#tblModels_"+t;$(r+" tbody").children().remove();for(var i=0;i'+n[i].ModelNo+"<\/td><\/tr>")}function addAlterList(n,t){console.log(n,t);let r="#divAlters_"+t;$(r).children().remove();for(var i=0;i'+n[i].Name+'<\/b> <\/a> '+n[i].Price+"<\/b> "+n[i].Sku+"<\/span> "+(n[i].InStock==!0?'<\/div> موجود<\/span>':'<\/div> ناموجود<\/span>')+(i!=n.length-1?" ":""))}}function openAlter(n){$.ajax({cache:!1,"async":!0,type:"POST",url:"/Specifications/getProductParent",data:{productId:n},success:function(n){n!=null&&(console.log(n,"data88"),window.open("/"+n.SeName,"_blank"))}})}function setStock(n,t,i,r){var u;u=i==2?stockProducts.find(n=>n.sku==r+"IR"):assocsitedProducts.find(n=>n.id==t);setTimeout(setSpecifications(u.id,t),5e3);$("#variant-"+t).text(u.name);$("#price-value-"+t).text(u.price);$("#stock-"+t).find("div:first").removeClass("withStock1");$("#stock-"+t).find("div:first").removeClass("noStock1");$("#stock-"+t).find("div:first").addClass(u.stock=="True"?"withStock1":"noStock1");$("#stock-"+t).find("b").text(u.stock=="True"?"موجود":"ناموجود");$("#sku-"+t).text(u.sku);$("#add-to-cart-button-"+t).attr("data-productid",u.id);$("#add-to-cart-button-"+t).attr("onclick",'return AjaxCart.addproducttocart_details("/addproducttocart/details/'+u.id+'/1","#product-details-form"),!1')}function setMainImage(n,t){$("#divGallery").find("img").removeClass("activeImg");$("#divMainPicture img").attr("src",t);$(n).addClass("activeImg")}function setSpecifications(n,t){let r=productList.find(t=>t.productId==n).product,i=productList.find(n=>n.productId==t).product;addAlterList(r.alterListDto,t);addSpecifications(i.specs,t);addPictures(i.PictureModels,t);addModels(i.relatedmodels,t)}var selectedSku=localStorage.getItem("selectedSku"),countt,i,p,mainProduct;localStorage.removeItem("selectedSku");var assocsitedProducts=[],stockProducts=[],productList=[];$("#divGallery").find("img:first").addClass("activeImg");$("#divMainPicture").hiZoom({width:300,height:200,position:"left",distance:1});$(".hizoom").hiZoom({width:300,height:200,position:"left",distance:1});countt="10";i=1;stockProducts.push({id:"15754",name:"4680R-C016B",stock:"True",price:" 30,000 تومان",sku:"4680R-C016B"});stockProducts.push({id:"15755",name:"4680R-C016B",stock:"False",price:" 15,000 تومان",sku:"4680R-C016BIR"});stockProducts.push({id:"15756",name:"4680R-E008A",stock:"True",price:" 30,000 تومان",sku:"4680R-E008A"});stockProducts.push({id:"15757",name:"4680R-E008A",stock:"False",price:" 20,000 تومان",sku:"4680R-E008AIR"});stockProducts.push({id:"15758",name:"4680R-E009A",stock:"True",price:" 30,000 تومان",sku:"4680R-E009A"});stockProducts.push({id:"15759",name:"4680R-E009A",stock:"False",price:" 20,000 تومان",sku:"4680R-E009AIR"});stockProducts.push({id:"15760",name:"4681R-B009B",stock:"True",price:" 30,000 تومان",sku:"4681R-B009B"});stockProducts.push({id:"15761",name:"4681R-B009B",stock:"False",price:" 20,000 تومان",sku:"4681R-B009BIR"});stockProducts.push({id:"15762",name:"4681RBA002A",stock:"True",price:" 30,000 تومان",sku:"4681RBA002A"});stockProducts.push({id:"15763",name:"4681RBA002A",stock:"False",price:" 20,000 تومان",sku:"4681RBA002AIR"});console.log(countt,"countt");getProductDetail("15754");console.log("4680R-C016B_selected:"+selectedSku,"4680R-C016B".indexOf(selectedSku));$("#div_15754").offset()!==undefined&&"4680R-C016B".indexOf(selectedSku)!=-1&&selectedSku!=null&&$([document.documentElement,document.body]).animate({scrollTop:$("#div_15754").offset().top-200},500);selectedSku!=null&&"4680R-C016B".indexOf(selectedSku)!=-1&&$("#div_15754").css("border-top","2px solid red");assocsitedProducts.push({id:"15754",name:"4680R-C016B",stock:"True",price:" 30,000 تومان",sku:"4680R-C016B"});$("input[name=radio-15754][value='1']").prop("checked",!0);console.log(countt,"countt");getProductDetail("15755");console.log("4680R-C016BIR_selected:"+selectedSku,"4680R-C016BIR".indexOf(selectedSku));$("#div_15754").offset()!==undefined&&"4680R-C016BIR".indexOf(selectedSku)!=-1&&selectedSku!=null&&$([document.documentElement,document.body]).animate({scrollTop:$("#div_15754").offset().top-200},500);selectedSku!=null&&"4680R-C016BIR".indexOf(selectedSku)!=-1&&$("#div_15754").css("border-top","2px solid red");p="4680R-C016B";mainProduct=stockProducts.find(n=>n.sku==p);console.log(p,"p");console.log(mainProduct,"mainProduct");mainProduct.stock!="True"&&$("input[name=radio-15754][value='1']").prop("checked",!0);console.log(countt,"countt");getProductDetail("15756");console.log("4680R-E008A_selected:"+selectedSku,"4680R-E008A".indexOf(selectedSku));$("#div_15756").offset()!==undefined&&"4680R-E008A".indexOf(selectedSku)!=-1&&selectedSku!=null&&$([document.documentElement,document.body]).animate({scrollTop:$("#div_15756").offset().top-200},500);selectedSku!=null&&"4680R-E008A".indexOf(selectedSku)!=-1&&$("#div_15756").css("border-top","2px solid red");assocsitedProducts.push({id:"15756",name:"4680R-E008A",stock:"True",price:" 30,000 تومان",sku:"4680R-E008A"});$("input[name=radio-15756][value='1']").prop("checked",!0);console.log(countt,"countt");getProductDetail("15757");console.log("4680R-E008AIR_selected:"+selectedSku,"4680R-E008AIR".indexOf(selectedSku));$("#div_15756").offset()!==undefined&&"4680R-E008AIR".indexOf(selectedSku)!=-1&&selectedSku!=null&&$([document.documentElement,document.body]).animate({scrollTop:$("#div_15756").offset().top-200},500);selectedSku!=null&&"4680R-E008AIR".indexOf(selectedSku)!=-1&&$("#div_15756").css("border-top","2px solid red");p="4680R-E008A";mainProduct=stockProducts.find(n=>n.sku==p);console.log(p,"p");console.log(mainProduct,"mainProduct");mainProduct.stock!="True"&&$("input[name=radio-15756][value='1']").prop("checked",!0);console.log(countt,"countt");getProductDetail("15758");console.log("4680R-E009A_selected:"+selectedSku,"4680R-E009A".indexOf(selectedSku));$("#div_15758").offset()!==undefined&&"4680R-E009A".indexOf(selectedSku)!=-1&&selectedSku!=null&&$([document.documentElement,document.body]).animate({scrollTop:$("#div_15758").offset().top-200},500);selectedSku!=null&&"4680R-E009A".indexOf(selectedSku)!=-1&&$("#div_15758").css("border-top","2px solid red");assocsitedProducts.push({id:"15758",name:"4680R-E009A",stock:"True",price:" 30,000 تومان",sku:"4680R-E009A"});$("input[name=radio-15758][value='1']").prop("checked",!0);console.log(countt,"countt");getProductDetail("15759");console.log("4680R-E009AIR_selected:"+selectedSku,"4680R-E009AIR".indexOf(selectedSku));$("#div_15758").offset()!==undefined&&"4680R-E009AIR".indexOf(selectedSku)!=-1&&selectedSku!=null&&$([document.documentElement,document.body]).animate({scrollTop:$("#div_15758").offset().top-200},500);selectedSku!=null&&"4680R-E009AIR".indexOf(selectedSku)!=-1&&$("#div_15758").css("border-top","2px solid red");p="4680R-E009A";mainProduct=stockProducts.find(n=>n.sku==p);console.log(p,"p");console.log(mainProduct,"mainProduct");mainProduct.stock!="True"&&$("input[name=radio-15758][value='1']").prop("checked",!0);console.log(countt,"countt");getProductDetail("15760");console.log("4681R-B009B_selected:"+selectedSku,"4681R-B009B".indexOf(selectedSku));$("#div_15760").offset()!==undefined&&"4681R-B009B".indexOf(selectedSku)!=-1&&selectedSku!=null&&$([document.documentElement,document.body]).animate({scrollTop:$("#div_15760").offset().top-200},500);selectedSku!=null&&"4681R-B009B".indexOf(selectedSku)!=-1&&$("#div_15760").css("border-top","2px solid red");assocsitedProducts.push({id:"15760",name:"4681R-B009B",stock:"True",price:" 30,000 تومان",sku:"4681R-B009B"});$("input[name=radio-15760][value='1']").prop("checked",!0);console.log(countt,"countt");getProductDetail("15761");console.log("4681R-B009BIR_selected:"+selectedSku,"4681R-B009BIR".indexOf(selectedSku));$("#div_15760").offset()!==undefined&&"4681R-B009BIR".indexOf(selectedSku)!=-1&&selectedSku!=null&&$([document.documentElement,document.body]).animate({scrollTop:$("#div_15760").offset().top-200},500);selectedSku!=null&&"4681R-B009BIR".indexOf(selectedSku)!=-1&&$("#div_15760").css("border-top","2px solid red");p="4681R-B009B";mainProduct=stockProducts.find(n=>n.sku==p);console.log(p,"p");console.log(mainProduct,"mainProduct");mainProduct.stock!="True"&&$("input[name=radio-15760][value='1']").prop("checked",!0);console.log(countt,"countt");getProductDetail("15762");console.log("4681RBA002A_selected:"+selectedSku,"4681RBA002A".indexOf(selectedSku));$("#div_15762").offset()!==undefined&&"4681RBA002A".indexOf(selectedSku)!=-1&&selectedSku!=null&&$([document.documentElement,document.body]).animate({scrollTop:$("#div_15762").offset().top-200},500);selectedSku!=null&&"4681RBA002A".indexOf(selectedSku)!=-1&&$("#div_15762").css("border-top","2px solid red");assocsitedProducts.push({id:"15762",name:"4681RBA002A",stock:"True",price:" 30,000 تومان",sku:"4681RBA002A"});$("input[name=radio-15762][value='1']").prop("checked",!0);console.log(countt,"countt");getProductDetail("15763");console.log("4681RBA002AIR_selected:"+selectedSku,"4681RBA002AIR".indexOf(selectedSku));$("#div_15762").offset()!==undefined&&"4681RBA002AIR".indexOf(selectedSku)!=-1&&selectedSku!=null&&$([document.documentElement,document.body]).animate({scrollTop:$("#div_15762").offset().top-200},500);selectedSku!=null&&"4681RBA002AIR".indexOf(selectedSku)!=-1&&$("#div_15762").css("border-top","2px solid red");p="4681RBA002A";mainProduct=stockProducts.find(n=>n.sku==p);console.log(p,"p");console.log(mainProduct,"mainProduct");mainProduct.stock!="True"&&$("input[name=radio-15762][value='1']").prop("checked",!0);$(function(){$(".hizoom").on("click",function(){let n=$(this).find("img").attr("src");$("#myModalBody").children().remove();$("#myModalBody").append('');var t=new bootstrap.Modal(document.getElementById("exampleModal"),{keyboard:!1});t.show()})})
| |