"+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="8";i=1;stockProducts.push({id:"28869",name:"K4562TP",stock:"True",price:" 280,000 تومان",sku:"K4562TPIR"});stockProducts.push({id:"28870",name:"K4562TP",stock:"False",price:" 580,000 تومان",sku:"K4562TP"});stockProducts.push({id:"28871",name:"K4563TP",stock:"True",price:" 280,000 تومان",sku:"K4563TPIR"});stockProducts.push({id:"28872",name:"K4563TP",stock:"False",price:" 480,000 تومان",sku:"K4563TP"});stockProducts.push({id:"28873",name:"K4564TP",stock:"True",price:" 280,000 تومان",sku:"K4564TPIR"});stockProducts.push({id:"28874",name:"K4564TP",stock:"False",price:" 580,000 تومان",sku:"K4564TP"});stockProducts.push({id:"28875",name:"K4565TP",stock:"True",price:" 280,000 تومان",sku:"K4565TPIR"});stockProducts.push({id:"28876",name:"K4565TP",stock:"False",price:" 480,000 تومان",sku:"K4565TP"});console.log(countt,"countt");getProductDetail("28869");console.log("K4562TPIR_selected:"+selectedSku,"K4562TPIR".indexOf(selectedSku));$("#div_28868").offset()!==undefined&&"K4562TPIR".indexOf(selectedSku)!=-1&&selectedSku!=null&&$([document.documentElement,document.body]).animate({scrollTop:$("#div_28868").offset().top-200},500);selectedSku!=null&&"K4562TPIR".indexOf(selectedSku)!=-1&&$("#div_28868").css("border-top","2px solid red");p="K4562TP";mainProduct=stockProducts.find(n=>n.sku==p);console.log(p,"p");console.log(mainProduct,"mainProduct");mainProduct.stock!="True"&&$("input[name=radio-28868][value='2']").prop("checked",!0);console.log(countt,"countt");getProductDetail("28870");console.log("K4562TP_selected:"+selectedSku,"K4562TP".indexOf(selectedSku));$("#div_28870").offset()!==undefined&&"K4562TP".indexOf(selectedSku)!=-1&&selectedSku!=null&&$([document.documentElement,document.body]).animate({scrollTop:$("#div_28870").offset().top-200},500);selectedSku!=null&&"K4562TP".indexOf(selectedSku)!=-1&&$("#div_28870").css("border-top","2px solid red");assocsitedProducts.push({id:"28870",name:"K4562TP",stock:"False",price:" 580,000 تومان",sku:"K4562TP"});console.log(countt,"countt");getProductDetail("28871");console.log("K4563TPIR_selected:"+selectedSku,"K4563TPIR".indexOf(selectedSku));$("#div_28870").offset()!==undefined&&"K4563TPIR".indexOf(selectedSku)!=-1&&selectedSku!=null&&$([document.documentElement,document.body]).animate({scrollTop:$("#div_28870").offset().top-200},500);selectedSku!=null&&"K4563TPIR".indexOf(selectedSku)!=-1&&$("#div_28870").css("border-top","2px solid red");p="K4563TP";mainProduct=stockProducts.find(n=>n.sku==p);console.log(p,"p");console.log(mainProduct,"mainProduct");mainProduct.stock!="True"&&$("input[name=radio-28870][value='2']").prop("checked",!0);console.log(countt,"countt");getProductDetail("28872");console.log("K4563TP_selected:"+selectedSku,"K4563TP".indexOf(selectedSku));$("#div_28872").offset()!==undefined&&"K4563TP".indexOf(selectedSku)!=-1&&selectedSku!=null&&$([document.documentElement,document.body]).animate({scrollTop:$("#div_28872").offset().top-200},500);selectedSku!=null&&"K4563TP".indexOf(selectedSku)!=-1&&$("#div_28872").css("border-top","2px solid red");assocsitedProducts.push({id:"28872",name:"K4563TP",stock:"False",price:" 480,000 تومان",sku:"K4563TP"});console.log(countt,"countt");getProductDetail("28873");console.log("K4564TPIR_selected:"+selectedSku,"K4564TPIR".indexOf(selectedSku));$("#div_28872").offset()!==undefined&&"K4564TPIR".indexOf(selectedSku)!=-1&&selectedSku!=null&&$([document.documentElement,document.body]).animate({scrollTop:$("#div_28872").offset().top-200},500);selectedSku!=null&&"K4564TPIR".indexOf(selectedSku)!=-1&&$("#div_28872").css("border-top","2px solid red");p="K4564TP";mainProduct=stockProducts.find(n=>n.sku==p);console.log(p,"p");console.log(mainProduct,"mainProduct");mainProduct.stock!="True"&&$("input[name=radio-28872][value='2']").prop("checked",!0);console.log(countt,"countt");getProductDetail("28874");console.log("K4564TP_selected:"+selectedSku,"K4564TP".indexOf(selectedSku));$("#div_28874").offset()!==undefined&&"K4564TP".indexOf(selectedSku)!=-1&&selectedSku!=null&&$([document.documentElement,document.body]).animate({scrollTop:$("#div_28874").offset().top-200},500);selectedSku!=null&&"K4564TP".indexOf(selectedSku)!=-1&&$("#div_28874").css("border-top","2px solid red");assocsitedProducts.push({id:"28874",name:"K4564TP",stock:"False",price:" 580,000 تومان",sku:"K4564TP"});console.log(countt,"countt");getProductDetail("28875");console.log("K4565TPIR_selected:"+selectedSku,"K4565TPIR".indexOf(selectedSku));$("#div_28874").offset()!==undefined&&"K4565TPIR".indexOf(selectedSku)!=-1&&selectedSku!=null&&$([document.documentElement,document.body]).animate({scrollTop:$("#div_28874").offset().top-200},500);selectedSku!=null&&"K4565TPIR".indexOf(selectedSku)!=-1&&$("#div_28874").css("border-top","2px solid red");p="K4565TP";mainProduct=stockProducts.find(n=>n.sku==p);console.log(p,"p");console.log(mainProduct,"mainProduct");mainProduct.stock!="True"&&$("input[name=radio-28874][value='2']").prop("checked",!0);console.log(countt,"countt");getProductDetail("28876");console.log("K4565TP_selected:"+selectedSku,"K4565TP".indexOf(selectedSku));$("#div_28876").offset()!==undefined&&"K4565TP".indexOf(selectedSku)!=-1&&selectedSku!=null&&$([document.documentElement,document.body]).animate({scrollTop:$("#div_28876").offset().top-200},500);selectedSku!=null&&"K4565TP".indexOf(selectedSku)!=-1&&$("#div_28876").css("border-top","2px solid red");assocsitedProducts.push({id:"28876",name:"K4565TP",stock:"False",price:" 480,000 تومان",sku:"K4565TP"});$(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()})})
| |