"+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;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="4";i=1;stockProducts.push({id:"27033",name:"پنل تلویزیون 65 سونی-4K",stock:"False",price:" تومان",sku:"ST6451D03-5"});stockProducts.push({id:"29363",name:"پنل تلویزیون 65 سونی",stock:"True",price:" تومان",sku:"ST6451D07-6"});stockProducts.push({id:"29374",name:"پنل تلویزیون سونی",stock:"False",price:" تومان",sku:"HV650QUB-N9L"});stockProducts.push({id:"29958",name:"پنل تلویزیون 65 سونی",stock:"False",price:" تومان",sku:"HV650QUB-N9K"});console.log(countt,"countt");getProductDetail("27033");console.log("ST6451D03-5_selected:"+selectedSku,"ST6451D03-5".indexOf(selectedSku));$("#div_27033").offset()!==undefined&&"ST6451D03-5".indexOf(selectedSku)!=-1&&selectedSku!=null&&$([document.documentElement,document.body]).animate({scrollTop:$("#div_27033").offset().top-200},500);selectedSku!=null&&"ST6451D03-5".indexOf(selectedSku)!=-1&&$("#div_27033").css("border-top","2px solid red");assocsitedProducts.push({id:"27033",name:"پنل تلویزیون 65 سونی-4K",stock:"False",price:" تومان",sku:"ST6451D03-5"});console.log(countt,"countt");getProductDetail("29363");console.log("ST6451D07-6_selected:"+selectedSku,"ST6451D07-6".indexOf(selectedSku));$("#div_29363").offset()!==undefined&&"ST6451D07-6".indexOf(selectedSku)!=-1&&selectedSku!=null&&$([document.documentElement,document.body]).animate({scrollTop:$("#div_29363").offset().top-200},500);selectedSku!=null&&"ST6451D07-6".indexOf(selectedSku)!=-1&&$("#div_29363").css("border-top","2px solid red");assocsitedProducts.push({id:"29363",name:"پنل تلویزیون 65 سونی",stock:"True",price:" تومان",sku:"ST6451D07-6"});$("input[name=radio-29363][value='1']").prop("checked",!0);console.log(countt,"countt");getProductDetail("29374");console.log("HV650QUB-N9L_selected:"+selectedSku,"HV650QUB-N9L".indexOf(selectedSku));$("#div_29374").offset()!==undefined&&"HV650QUB-N9L".indexOf(selectedSku)!=-1&&selectedSku!=null&&$([document.documentElement,document.body]).animate({scrollTop:$("#div_29374").offset().top-200},500);selectedSku!=null&&"HV650QUB-N9L".indexOf(selectedSku)!=-1&&$("#div_29374").css("border-top","2px solid red");assocsitedProducts.push({id:"29374",name:"پنل تلویزیون سونی",stock:"False",price:" تومان",sku:"HV650QUB-N9L"});console.log(countt,"countt");getProductDetail("29958");console.log("HV650QUB-N9K_selected:"+selectedSku,"HV650QUB-N9K".indexOf(selectedSku));$("#div_29958").offset()!==undefined&&"HV650QUB-N9K".indexOf(selectedSku)!=-1&&selectedSku!=null&&$([document.documentElement,document.body]).animate({scrollTop:$("#div_29958").offset().top-200},500);selectedSku!=null&&"HV650QUB-N9K".indexOf(selectedSku)!=-1&&$("#div_29958").css("border-top","2px solid red");assocsitedProducts.push({id:"29958",name:"پنل تلویزیون 65 سونی",stock:"False",price:" تومان",sku:"HV650QUB-N9K"});$(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()})})
| |