"+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:"11888",name:"بکلایت 43LJ",stock:"False",price:" 490,000 تومان",sku:"AGF43LJ52A3"});stockProducts.push({id:"11889",name:"بکلایت 43LJ شاخه 3 تایی سری 52100",stock:"True",price:" 170,000 تومان",sku:"AGF43LJ52A3IR"});stockProducts.push({id:"11890",name:"بکلایت 43LJ شاخه 3 تایی سری 52100",stock:"False",price:" 550,000 تومان",sku:"AGF43LJ5A02"});stockProducts.push({id:"11891",name:"بکلایت 43LJ شاخه 2 تایی سری 5",stock:"False",price:" 170,000 تومان",sku:"AGF43LJ5A02IR"});stockProducts.push({id:"11892",name:"بکلایت 43LJ شاخه 2 تایی سری 5",stock:"False",price:" 570,000 تومان",sku:"AGF43LJ5C02"});stockProducts.push({id:"11893",name:"بکلایت 43LJ شاخه 2 تایی سری 5",stock:"False",price:" 170,000 تومان",sku:"AGF43LJ5C02IR"});stockProducts.push({id:"16393",name:"بکلایت 43LJ شاخه 3 تایی سری 5",stock:"False",price:" 490,000 تومان",sku:"AGF43LJ5A03"});stockProducts.push({id:"16394",name:"بکلایت 43LJ شاخه 3 تایی سری 5",stock:"True",price:" 170,000 تومان",sku:"AGF43LJ5A03IR"});console.log(countt,"countt");getProductDetail("11888");console.log("AGF43LJ52A3_selected:"+selectedSku,"AGF43LJ52A3".indexOf(selectedSku));$("#div_11888").offset()!==undefined&&"AGF43LJ52A3".indexOf(selectedSku)!=-1&&selectedSku!=null&&$([document.documentElement,document.body]).animate({scrollTop:$("#div_11888").offset().top-200},500);selectedSku!=null&&"AGF43LJ52A3".indexOf(selectedSku)!=-1&&$("#div_11888").css("border-top","2px solid red");assocsitedProducts.push({id:"11888",name:"بکلایت 43LJ",stock:"False",price:" 490,000 تومان",sku:"AGF43LJ52A3"});console.log(countt,"countt");getProductDetail("11889");console.log("AGF43LJ52A3IR_selected:"+selectedSku,"AGF43LJ52A3IR".indexOf(selectedSku));$("#div_11888").offset()!==undefined&&"AGF43LJ52A3IR".indexOf(selectedSku)!=-1&&selectedSku!=null&&$([document.documentElement,document.body]).animate({scrollTop:$("#div_11888").offset().top-200},500);selectedSku!=null&&"AGF43LJ52A3IR".indexOf(selectedSku)!=-1&&$("#div_11888").css("border-top","2px solid red");p="AGF43LJ52A3";mainProduct=stockProducts.find(n=>n.sku==p);console.log(p,"p");console.log(mainProduct,"mainProduct");mainProduct.stock!="True"&&$("input[name=radio-11888][value='2']").prop("checked",!0);console.log(countt,"countt");getProductDetail("11890");console.log("AGF43LJ5A02_selected:"+selectedSku,"AGF43LJ5A02".indexOf(selectedSku));$("#div_11890").offset()!==undefined&&"AGF43LJ5A02".indexOf(selectedSku)!=-1&&selectedSku!=null&&$([document.documentElement,document.body]).animate({scrollTop:$("#div_11890").offset().top-200},500);selectedSku!=null&&"AGF43LJ5A02".indexOf(selectedSku)!=-1&&$("#div_11890").css("border-top","2px solid red");assocsitedProducts.push({id:"11890",name:"بکلایت 43LJ شاخه 3 تایی سری 52100",stock:"False",price:" 550,000 تومان",sku:"AGF43LJ5A02"});console.log(countt,"countt");getProductDetail("11891");console.log("AGF43LJ5A02IR_selected:"+selectedSku,"AGF43LJ5A02IR".indexOf(selectedSku));$("#div_11890").offset()!==undefined&&"AGF43LJ5A02IR".indexOf(selectedSku)!=-1&&selectedSku!=null&&$([document.documentElement,document.body]).animate({scrollTop:$("#div_11890").offset().top-200},500);selectedSku!=null&&"AGF43LJ5A02IR".indexOf(selectedSku)!=-1&&$("#div_11890").css("border-top","2px solid red");p="AGF43LJ5A02";mainProduct=stockProducts.find(n=>n.sku==p);console.log(p,"p");console.log(mainProduct,"mainProduct");mainProduct.stock!="True"&&$("input[name=radio-11890][value='1']").prop("checked",!0);console.log(countt,"countt");getProductDetail("11892");console.log("AGF43LJ5C02_selected:"+selectedSku,"AGF43LJ5C02".indexOf(selectedSku));$("#div_11892").offset()!==undefined&&"AGF43LJ5C02".indexOf(selectedSku)!=-1&&selectedSku!=null&&$([document.documentElement,document.body]).animate({scrollTop:$("#div_11892").offset().top-200},500);selectedSku!=null&&"AGF43LJ5C02".indexOf(selectedSku)!=-1&&$("#div_11892").css("border-top","2px solid red");assocsitedProducts.push({id:"11892",name:"بکلایت 43LJ شاخه 2 تایی سری 5",stock:"False",price:" 570,000 تومان",sku:"AGF43LJ5C02"});console.log(countt,"countt");getProductDetail("11893");console.log("AGF43LJ5C02IR_selected:"+selectedSku,"AGF43LJ5C02IR".indexOf(selectedSku));$("#div_11892").offset()!==undefined&&"AGF43LJ5C02IR".indexOf(selectedSku)!=-1&&selectedSku!=null&&$([document.documentElement,document.body]).animate({scrollTop:$("#div_11892").offset().top-200},500);selectedSku!=null&&"AGF43LJ5C02IR".indexOf(selectedSku)!=-1&&$("#div_11892").css("border-top","2px solid red");p="AGF43LJ5C02";mainProduct=stockProducts.find(n=>n.sku==p);console.log(p,"p");console.log(mainProduct,"mainProduct");mainProduct.stock!="True"&&$("input[name=radio-11892][value='1']").prop("checked",!0);console.log(countt,"countt");getProductDetail("16393");console.log("AGF43LJ5A03_selected:"+selectedSku,"AGF43LJ5A03".indexOf(selectedSku));$("#div_16393").offset()!==undefined&&"AGF43LJ5A03".indexOf(selectedSku)!=-1&&selectedSku!=null&&$([document.documentElement,document.body]).animate({scrollTop:$("#div_16393").offset().top-200},500);selectedSku!=null&&"AGF43LJ5A03".indexOf(selectedSku)!=-1&&$("#div_16393").css("border-top","2px solid red");assocsitedProducts.push({id:"16393",name:"بکلایت 43LJ شاخه 3 تایی سری 5",stock:"False",price:" 490,000 تومان",sku:"AGF43LJ5A03"});console.log(countt,"countt");getProductDetail("16394");console.log("AGF43LJ5A03IR_selected:"+selectedSku,"AGF43LJ5A03IR".indexOf(selectedSku));$("#div_16393").offset()!==undefined&&"AGF43LJ5A03IR".indexOf(selectedSku)!=-1&&selectedSku!=null&&$([document.documentElement,document.body]).animate({scrollTop:$("#div_16393").offset().top-200},500);selectedSku!=null&&"AGF43LJ5A03IR".indexOf(selectedSku)!=-1&&$("#div_16393").css("border-top","2px solid red");p="AGF43LJ5A03";mainProduct=stockProducts.find(n=>n.sku==p);console.log(p,"p");console.log(mainProduct,"mainProduct");mainProduct.stock!="True"&&$("input[name=radio-16393][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()})})
| |