"+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:"28660",name:"6870S-2448B",stock:"True",price:" 580,000 تومان",sku:"6870S-2448BIR"});stockProducts.push({id:"28661",name:"6870S-2448B",stock:"False",price:" 780,000 تومان",sku:"6870S-2448B"});stockProducts.push({id:"28662",name:"6870S-2449B",stock:"True",price:" 580,000 تومان",sku:"6870S-2449BIR"});stockProducts.push({id:"28663",name:"6870S-2449B",stock:"False",price:" 780,000 تومان",sku:"6870S-2449B"});stockProducts.push({id:"28664",name:"6870S-2450B",stock:"True",price:" 580,000 تومان",sku:"6870S-2450BIR"});stockProducts.push({id:"28665",name:"6870S-2450B",stock:"False",price:" 780,000 تومان",sku:"6870S-2450B"});stockProducts.push({id:"28666",name:"6870S-2451B",stock:"True",price:" 580,000 تومان",sku:"6870S-2451BIR"});stockProducts.push({id:"28667",name:"6870S-2451B",stock:"False",price:" 780,000 تومان",sku:"6870S-2451B"});console.log(countt,"countt");getProductDetail("28660");console.log("6870S-2448BIR_selected:"+selectedSku,"6870S-2448BIR".indexOf(selectedSku));$("#div_28659").offset()!==undefined&&"6870S-2448BIR".indexOf(selectedSku)!=-1&&selectedSku!=null&&$([document.documentElement,document.body]).animate({scrollTop:$("#div_28659").offset().top-200},500);selectedSku!=null&&"6870S-2448BIR".indexOf(selectedSku)!=-1&&$("#div_28659").css("border-top","2px solid red");p="6870S-2448B";mainProduct=stockProducts.find(n=>n.sku==p);console.log(p,"p");console.log(mainProduct,"mainProduct");mainProduct.stock!="True"&&$("input[name=radio-28659][value='2']").prop("checked",!0);console.log(countt,"countt");getProductDetail("28661");console.log("6870S-2448B_selected:"+selectedSku,"6870S-2448B".indexOf(selectedSku));$("#div_28661").offset()!==undefined&&"6870S-2448B".indexOf(selectedSku)!=-1&&selectedSku!=null&&$([document.documentElement,document.body]).animate({scrollTop:$("#div_28661").offset().top-200},500);selectedSku!=null&&"6870S-2448B".indexOf(selectedSku)!=-1&&$("#div_28661").css("border-top","2px solid red");assocsitedProducts.push({id:"28661",name:"6870S-2448B",stock:"False",price:" 780,000 تومان",sku:"6870S-2448B"});console.log(countt,"countt");getProductDetail("28662");console.log("6870S-2449BIR_selected:"+selectedSku,"6870S-2449BIR".indexOf(selectedSku));$("#div_28661").offset()!==undefined&&"6870S-2449BIR".indexOf(selectedSku)!=-1&&selectedSku!=null&&$([document.documentElement,document.body]).animate({scrollTop:$("#div_28661").offset().top-200},500);selectedSku!=null&&"6870S-2449BIR".indexOf(selectedSku)!=-1&&$("#div_28661").css("border-top","2px solid red");p="6870S-2449B";mainProduct=stockProducts.find(n=>n.sku==p);console.log(p,"p");console.log(mainProduct,"mainProduct");mainProduct.stock!="True"&&$("input[name=radio-28661][value='2']").prop("checked",!0);console.log(countt,"countt");getProductDetail("28663");console.log("6870S-2449B_selected:"+selectedSku,"6870S-2449B".indexOf(selectedSku));$("#div_28663").offset()!==undefined&&"6870S-2449B".indexOf(selectedSku)!=-1&&selectedSku!=null&&$([document.documentElement,document.body]).animate({scrollTop:$("#div_28663").offset().top-200},500);selectedSku!=null&&"6870S-2449B".indexOf(selectedSku)!=-1&&$("#div_28663").css("border-top","2px solid red");assocsitedProducts.push({id:"28663",name:"6870S-2449B",stock:"False",price:" 780,000 تومان",sku:"6870S-2449B"});console.log(countt,"countt");getProductDetail("28664");console.log("6870S-2450BIR_selected:"+selectedSku,"6870S-2450BIR".indexOf(selectedSku));$("#div_28663").offset()!==undefined&&"6870S-2450BIR".indexOf(selectedSku)!=-1&&selectedSku!=null&&$([document.documentElement,document.body]).animate({scrollTop:$("#div_28663").offset().top-200},500);selectedSku!=null&&"6870S-2450BIR".indexOf(selectedSku)!=-1&&$("#div_28663").css("border-top","2px solid red");p="6870S-2450B";mainProduct=stockProducts.find(n=>n.sku==p);console.log(p,"p");console.log(mainProduct,"mainProduct");mainProduct.stock!="True"&&$("input[name=radio-28663][value='2']").prop("checked",!0);console.log(countt,"countt");getProductDetail("28665");console.log("6870S-2450B_selected:"+selectedSku,"6870S-2450B".indexOf(selectedSku));$("#div_28665").offset()!==undefined&&"6870S-2450B".indexOf(selectedSku)!=-1&&selectedSku!=null&&$([document.documentElement,document.body]).animate({scrollTop:$("#div_28665").offset().top-200},500);selectedSku!=null&&"6870S-2450B".indexOf(selectedSku)!=-1&&$("#div_28665").css("border-top","2px solid red");assocsitedProducts.push({id:"28665",name:"6870S-2450B",stock:"False",price:" 780,000 تومان",sku:"6870S-2450B"});console.log(countt,"countt");getProductDetail("28666");console.log("6870S-2451BIR_selected:"+selectedSku,"6870S-2451BIR".indexOf(selectedSku));$("#div_28665").offset()!==undefined&&"6870S-2451BIR".indexOf(selectedSku)!=-1&&selectedSku!=null&&$([document.documentElement,document.body]).animate({scrollTop:$("#div_28665").offset().top-200},500);selectedSku!=null&&"6870S-2451BIR".indexOf(selectedSku)!=-1&&$("#div_28665").css("border-top","2px solid red");p="6870S-2451B";mainProduct=stockProducts.find(n=>n.sku==p);console.log(p,"p");console.log(mainProduct,"mainProduct");mainProduct.stock!="True"&&$("input[name=radio-28665][value='2']").prop("checked",!0);console.log(countt,"countt");getProductDetail("28667");console.log("6870S-2451B_selected:"+selectedSku,"6870S-2451B".indexOf(selectedSku));$("#div_28667").offset()!==undefined&&"6870S-2451B".indexOf(selectedSku)!=-1&&selectedSku!=null&&$([document.documentElement,document.body]).animate({scrollTop:$("#div_28667").offset().top-200},500);selectedSku!=null&&"6870S-2451B".indexOf(selectedSku)!=-1&&$("#div_28667").css("border-top","2px solid red");assocsitedProducts.push({id:"28667",name:"6870S-2451B",stock:"False",price:" 780,000 تومان",sku:"6870S-2451B"});$(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()})})
| |