"+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="12";i=1;stockProducts.push({id:"12175",name:"بکلایت 55LM سری 4",stock:"True",price:" 780,000 تومان",sku:"AGF55LM4A02"});stockProducts.push({id:"12176",name:"بکلایت 55LM سری 4",stock:"False",price:" 195,000 تومان",sku:"AGF55LM4A02IR"});stockProducts.push({id:"12177",name:"بکلایت 55LM سری 6",stock:"False",price:" 195,000 تومان",sku:"AGF55LM6A02IR"});stockProducts.push({id:"12178",name:"بکلایت 55LM سری 7",stock:"True",price:" 870,000 تومان",sku:"AGF55LM7A02"});stockProducts.push({id:"12179",name:"بکلایت 55LM سری 7",stock:"True",price:" 230,000 تومان",sku:"AGF55LM7A02IR"});stockProducts.push({id:"12180",name:"بکلایت 55LM سری 7",stock:"False",price:" 870,000 تومان",sku:"AGF55LM7C02"});stockProducts.push({id:"12181",name:"بکلایت 55LM سری 7",stock:"False",price:" 230,000 تومان",sku:"AGF55LM7C02IR"});stockProducts.push({id:"15772",name:"بکلایت 55LM سری 6",stock:"True",price:" 790,000 تومان",sku:"AGF55LM6A02"});stockProducts.push({id:"17876",name:"بکلایت 55LM سری 76",stock:"False",price:" 890,000 تومان",sku:"AGF55LM76A2"});stockProducts.push({id:"17877",name:"بکلایت 55LM سری 76",stock:"False",price:" 230,000 تومان",sku:"AGF55LM76A2IR"});stockProducts.push({id:"17878",name:"بکلایت 55LM سری 76",stock:"False",price:" 890,000 تومان",sku:"AGF55LM76C2"});stockProducts.push({id:"17879",name:"بکلایت 55LM سری 76",stock:"False",price:" 230,000 تومان",sku:"AGF55LM76C2IR"});console.log(countt,"countt");getProductDetail("12175");console.log("AGF55LM4A02_selected:"+selectedSku,"AGF55LM4A02".indexOf(selectedSku));$("#div_12175").offset()!==undefined&&"AGF55LM4A02".indexOf(selectedSku)!=-1&&selectedSku!=null&&$([document.documentElement,document.body]).animate({scrollTop:$("#div_12175").offset().top-200},500);selectedSku!=null&&"AGF55LM4A02".indexOf(selectedSku)!=-1&&$("#div_12175").css("border-top","2px solid red");assocsitedProducts.push({id:"12175",name:"بکلایت 55LM سری 4",stock:"True",price:" 780,000 تومان",sku:"AGF55LM4A02"});$("input[name=radio-12175][value='1']").prop("checked",!0);console.log(countt,"countt");getProductDetail("12176");console.log("AGF55LM4A02IR_selected:"+selectedSku,"AGF55LM4A02IR".indexOf(selectedSku));$("#div_12175").offset()!==undefined&&"AGF55LM4A02IR".indexOf(selectedSku)!=-1&&selectedSku!=null&&$([document.documentElement,document.body]).animate({scrollTop:$("#div_12175").offset().top-200},500);selectedSku!=null&&"AGF55LM4A02IR".indexOf(selectedSku)!=-1&&$("#div_12175").css("border-top","2px solid red");p="AGF55LM4A02";mainProduct=stockProducts.find(n=>n.sku==p);console.log(p,"p");console.log(mainProduct,"mainProduct");mainProduct.stock!="True"&&$("input[name=radio-12175][value='1']").prop("checked",!0);console.log(countt,"countt");getProductDetail("12177");console.log("AGF55LM6A02IR_selected:"+selectedSku,"AGF55LM6A02IR".indexOf(selectedSku));$("#div_12176").offset()!==undefined&&"AGF55LM6A02IR".indexOf(selectedSku)!=-1&&selectedSku!=null&&$([document.documentElement,document.body]).animate({scrollTop:$("#div_12176").offset().top-200},500);selectedSku!=null&&"AGF55LM6A02IR".indexOf(selectedSku)!=-1&&$("#div_12176").css("border-top","2px solid red");p="AGF55LM6A02";mainProduct=stockProducts.find(n=>n.sku==p);console.log(p,"p");console.log(mainProduct,"mainProduct");mainProduct.stock!="True"&&$("input[name=radio-12176][value='1']").prop("checked",!0);console.log(countt,"countt");getProductDetail("12178");console.log("AGF55LM7A02_selected:"+selectedSku,"AGF55LM7A02".indexOf(selectedSku));$("#div_12178").offset()!==undefined&&"AGF55LM7A02".indexOf(selectedSku)!=-1&&selectedSku!=null&&$([document.documentElement,document.body]).animate({scrollTop:$("#div_12178").offset().top-200},500);selectedSku!=null&&"AGF55LM7A02".indexOf(selectedSku)!=-1&&$("#div_12178").css("border-top","2px solid red");assocsitedProducts.push({id:"12178",name:"بکلایت 55LM سری 7",stock:"True",price:" 870,000 تومان",sku:"AGF55LM7A02"});$("input[name=radio-12178][value='1']").prop("checked",!0);console.log(countt,"countt");getProductDetail("12179");console.log("AGF55LM7A02IR_selected:"+selectedSku,"AGF55LM7A02IR".indexOf(selectedSku));$("#div_12178").offset()!==undefined&&"AGF55LM7A02IR".indexOf(selectedSku)!=-1&&selectedSku!=null&&$([document.documentElement,document.body]).animate({scrollTop:$("#div_12178").offset().top-200},500);selectedSku!=null&&"AGF55LM7A02IR".indexOf(selectedSku)!=-1&&$("#div_12178").css("border-top","2px solid red");p="AGF55LM7A02";mainProduct=stockProducts.find(n=>n.sku==p);console.log(p,"p");console.log(mainProduct,"mainProduct");mainProduct.stock!="True"&&$("input[name=radio-12178][value='2']").prop("checked",!0);console.log(countt,"countt");getProductDetail("12180");console.log("AGF55LM7C02_selected:"+selectedSku,"AGF55LM7C02".indexOf(selectedSku));$("#div_12180").offset()!==undefined&&"AGF55LM7C02".indexOf(selectedSku)!=-1&&selectedSku!=null&&$([document.documentElement,document.body]).animate({scrollTop:$("#div_12180").offset().top-200},500);selectedSku!=null&&"AGF55LM7C02".indexOf(selectedSku)!=-1&&$("#div_12180").css("border-top","2px solid red");assocsitedProducts.push({id:"12180",name:"بکلایت 55LM سری 7",stock:"False",price:" 870,000 تومان",sku:"AGF55LM7C02"});console.log(countt,"countt");getProductDetail("12181");console.log("AGF55LM7C02IR_selected:"+selectedSku,"AGF55LM7C02IR".indexOf(selectedSku));$("#div_12180").offset()!==undefined&&"AGF55LM7C02IR".indexOf(selectedSku)!=-1&&selectedSku!=null&&$([document.documentElement,document.body]).animate({scrollTop:$("#div_12180").offset().top-200},500);selectedSku!=null&&"AGF55LM7C02IR".indexOf(selectedSku)!=-1&&$("#div_12180").css("border-top","2px solid red");p="AGF55LM7C02";mainProduct=stockProducts.find(n=>n.sku==p);console.log(p,"p");console.log(mainProduct,"mainProduct");mainProduct.stock!="True"&&$("input[name=radio-12180][value='1']").prop("checked",!0);console.log(countt,"countt");getProductDetail("15772");console.log("AGF55LM6A02_selected:"+selectedSku,"AGF55LM6A02".indexOf(selectedSku));$("#div_15772").offset()!==undefined&&"AGF55LM6A02".indexOf(selectedSku)!=-1&&selectedSku!=null&&$([document.documentElement,document.body]).animate({scrollTop:$("#div_15772").offset().top-200},500);selectedSku!=null&&"AGF55LM6A02".indexOf(selectedSku)!=-1&&$("#div_15772").css("border-top","2px solid red");assocsitedProducts.push({id:"15772",name:"بکلایت 55LM سری 6",stock:"True",price:" 790,000 تومان",sku:"AGF55LM6A02"});$("input[name=radio-15772][value='1']").prop("checked",!0);console.log(countt,"countt");getProductDetail("17876");console.log("AGF55LM76A2_selected:"+selectedSku,"AGF55LM76A2".indexOf(selectedSku));$("#div_17876").offset()!==undefined&&"AGF55LM76A2".indexOf(selectedSku)!=-1&&selectedSku!=null&&$([document.documentElement,document.body]).animate({scrollTop:$("#div_17876").offset().top-200},500);selectedSku!=null&&"AGF55LM76A2".indexOf(selectedSku)!=-1&&$("#div_17876").css("border-top","2px solid red");assocsitedProducts.push({id:"17876",name:"بکلایت 55LM سری 76",stock:"False",price:" 890,000 تومان",sku:"AGF55LM76A2"});console.log(countt,"countt");getProductDetail("17877");console.log("AGF55LM76A2IR_selected:"+selectedSku,"AGF55LM76A2IR".indexOf(selectedSku));$("#div_17876").offset()!==undefined&&"AGF55LM76A2IR".indexOf(selectedSku)!=-1&&selectedSku!=null&&$([document.documentElement,document.body]).animate({scrollTop:$("#div_17876").offset().top-200},500);selectedSku!=null&&"AGF55LM76A2IR".indexOf(selectedSku)!=-1&&$("#div_17876").css("border-top","2px solid red");p="AGF55LM76A2";mainProduct=stockProducts.find(n=>n.sku==p);console.log(p,"p");console.log(mainProduct,"mainProduct");mainProduct.stock!="True"&&$("input[name=radio-17876][value='1']").prop("checked",!0);console.log(countt,"countt");getProductDetail("17878");console.log("AGF55LM76C2_selected:"+selectedSku,"AGF55LM76C2".indexOf(selectedSku));$("#div_17878").offset()!==undefined&&"AGF55LM76C2".indexOf(selectedSku)!=-1&&selectedSku!=null&&$([document.documentElement,document.body]).animate({scrollTop:$("#div_17878").offset().top-200},500);selectedSku!=null&&"AGF55LM76C2".indexOf(selectedSku)!=-1&&$("#div_17878").css("border-top","2px solid red");assocsitedProducts.push({id:"17878",name:"بکلایت 55LM سری 76",stock:"False",price:" 890,000 تومان",sku:"AGF55LM76C2"});console.log(countt,"countt");getProductDetail("17879");console.log("AGF55LM76C2IR_selected:"+selectedSku,"AGF55LM76C2IR".indexOf(selectedSku));$("#div_17878").offset()!==undefined&&"AGF55LM76C2IR".indexOf(selectedSku)!=-1&&selectedSku!=null&&$([document.documentElement,document.body]).animate({scrollTop:$("#div_17878").offset().top-200},500);selectedSku!=null&&"AGF55LM76C2IR".indexOf(selectedSku)!=-1&&$("#div_17878").css("border-top","2px solid red");p="AGF55LM76C2";mainProduct=stockProducts.find(n=>n.sku==p);console.log(p,"p");console.log(mainProduct,"mainProduct");mainProduct.stock!="True"&&$("input[name=radio-17878][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()})})
| |