"+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="6";i=1;stockProducts.push({id:"17336",name:"برد خط کشی TV",stock:"False",price:" 280,000 تومان",sku:"6B01M0025300R"});stockProducts.push({id:"17337",name:"برد خط کشی TV",stock:"True",price:" 180,000 تومان",sku:"6B01M0025300RIR"});stockProducts.push({id:"25539",name:"6B01M0025200R",stock:"False",price:" 380,000 تومان",sku:"6B01M0025200R"});stockProducts.push({id:"25540",name:"6B01M0025200R",stock:"True",price:" 260,000 تومان",sku:"6B01M0025200RIR"});stockProducts.push({id:"25541",name:"6B01M001LY00R",stock:"False",price:" 380,000 تومان",sku:"6B01M001LY00R"});stockProducts.push({id:"25542",name:"6B01M001LY00R",stock:"True",price:" 260,000 تومان",sku:"6B01M001LY00RIR"});console.log(countt,"countt");getProductDetail("17336");console.log("6B01M0025300R_selected:"+selectedSku,"6B01M0025300R".indexOf(selectedSku));$("#div_17336").offset()!==undefined&&"6B01M0025300R".indexOf(selectedSku)!=-1&&selectedSku!=null&&$([document.documentElement,document.body]).animate({scrollTop:$("#div_17336").offset().top-200},500);selectedSku!=null&&"6B01M0025300R".indexOf(selectedSku)!=-1&&$("#div_17336").css("border-top","2px solid red");assocsitedProducts.push({id:"17336",name:"برد خط کشی TV",stock:"False",price:" 280,000 تومان",sku:"6B01M0025300R"});console.log(countt,"countt");getProductDetail("17337");console.log("6B01M0025300RIR_selected:"+selectedSku,"6B01M0025300RIR".indexOf(selectedSku));$("#div_17336").offset()!==undefined&&"6B01M0025300RIR".indexOf(selectedSku)!=-1&&selectedSku!=null&&$([document.documentElement,document.body]).animate({scrollTop:$("#div_17336").offset().top-200},500);selectedSku!=null&&"6B01M0025300RIR".indexOf(selectedSku)!=-1&&$("#div_17336").css("border-top","2px solid red");p="6B01M0025300R";mainProduct=stockProducts.find(n=>n.sku==p);console.log(p,"p");console.log(mainProduct,"mainProduct");mainProduct.stock!="True"&&$("input[name=radio-17336][value='2']").prop("checked",!0);console.log(countt,"countt");getProductDetail("25539");console.log("6B01M0025200R_selected:"+selectedSku,"6B01M0025200R".indexOf(selectedSku));$("#div_25539").offset()!==undefined&&"6B01M0025200R".indexOf(selectedSku)!=-1&&selectedSku!=null&&$([document.documentElement,document.body]).animate({scrollTop:$("#div_25539").offset().top-200},500);selectedSku!=null&&"6B01M0025200R".indexOf(selectedSku)!=-1&&$("#div_25539").css("border-top","2px solid red");assocsitedProducts.push({id:"25539",name:"6B01M0025200R",stock:"False",price:" 380,000 تومان",sku:"6B01M0025200R"});console.log(countt,"countt");getProductDetail("25540");console.log("6B01M0025200RIR_selected:"+selectedSku,"6B01M0025200RIR".indexOf(selectedSku));$("#div_25539").offset()!==undefined&&"6B01M0025200RIR".indexOf(selectedSku)!=-1&&selectedSku!=null&&$([document.documentElement,document.body]).animate({scrollTop:$("#div_25539").offset().top-200},500);selectedSku!=null&&"6B01M0025200RIR".indexOf(selectedSku)!=-1&&$("#div_25539").css("border-top","2px solid red");p="6B01M0025200R";mainProduct=stockProducts.find(n=>n.sku==p);console.log(p,"p");console.log(mainProduct,"mainProduct");mainProduct.stock!="True"&&$("input[name=radio-25539][value='2']").prop("checked",!0);console.log(countt,"countt");getProductDetail("25541");console.log("6B01M001LY00R_selected:"+selectedSku,"6B01M001LY00R".indexOf(selectedSku));$("#div_25541").offset()!==undefined&&"6B01M001LY00R".indexOf(selectedSku)!=-1&&selectedSku!=null&&$([document.documentElement,document.body]).animate({scrollTop:$("#div_25541").offset().top-200},500);selectedSku!=null&&"6B01M001LY00R".indexOf(selectedSku)!=-1&&$("#div_25541").css("border-top","2px solid red");assocsitedProducts.push({id:"25541",name:"6B01M001LY00R",stock:"False",price:" 380,000 تومان",sku:"6B01M001LY00R"});console.log(countt,"countt");getProductDetail("25542");console.log("6B01M001LY00RIR_selected:"+selectedSku,"6B01M001LY00RIR".indexOf(selectedSku));$("#div_25541").offset()!==undefined&&"6B01M001LY00RIR".indexOf(selectedSku)!=-1&&selectedSku!=null&&$([document.documentElement,document.body]).animate({scrollTop:$("#div_25541").offset().top-200},500);selectedSku!=null&&"6B01M001LY00RIR".indexOf(selectedSku)!=-1&&$("#div_25541").css("border-top","2px solid red");p="6B01M001LY00R";mainProduct=stockProducts.find(n=>n.sku==p);console.log(p,"p");console.log(mainProduct,"mainProduct");mainProduct.stock!="True"&&$("input[name=radio-25541][value='2']").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()})})
| |