${item.Name}`)}function i(n){return`
`+(n.Price==null?`
Call for pricing: 0800699353`:`
${n.Price} ${n.PriceReversedTax}
`)+`
${n.Name}
`}$("#brand").select2();$("#model").select2();$("#product").select2();$("#specification").select2();$("#specification").hide();$("#specification").parent().hide();$("#specification").select2("destroy");var r={CategoryId:selectedCategoryState};displayAjaxLoading(!0);n("spare-parts-dropdown",r).success(function(n){sparePartsSelected=!1;catLocation=`/SparePartsFinder/ShowSpareParts?CategoryId=${selectedCategoryState}`;var i=``;$.each(n.brands,function(n,t){i+=``});$("#brand").html(i);i=``;$.each(n.models,function(n,t){i+=``});$("#model").html(i);n.specifications!=null?(i=``,$.each(n.specifications,function(n,t){i+=``}),$("#specification").html(i),$("#specification").show(),$("#specification").parent().show(),$("#specification").select2()):($("#specification").select2(),$("#specification").hide(),$("#specification").parent().hide(),$("#specification").select2("destroy"));$("#product").select2("destroy");selectedHtml=``;spareProductList=n.spareProducts;$.each(n.spareProducts,function(n,t){selectedHtml+=``});$("#product").empty();$("#product").html(selectedHtml);$("#product").select2({templateResult:t,closeOnSelect:!1})});$("#brand").on("change",function(){var i,r;($("#model").val("0"),$("#product").val("0"),i=$("#brand").val(),i!=""&&i!=0)&&(r={CategoryId:selectedCategoryState,BrandId:i},displayAjaxLoading(!0),n("get-model",r).success(function(n){sparePartsSelected=!1;catLocation=`/SparePartsFinder/ShowSpareParts?CategoryId=${selectedCategoryState}&BrandId=${i}`;var r=``;$.each(n.models,function(n,t){r+=``});$("#model").html(r);$("#product").select2("destroy");selectedHtml=``;spareProductList=n.spareProducts;$("#prd-info").empty();$.each(n.spareProducts,function(n,t){selectedHtml+=``});$("#product").empty();$("#product").html(selectedHtml);$("#product").select2({templateResult:t,closeOnSelect:!1})}))});$("#model").on("change",function(){var r=$(this).val(),u,f;r!=""&&r!=0&&(u=$("#brand").val(),f={ModelId:r,CategoryId:selectedCategoryState},displayAjaxLoading(!0),n(`get-spare-products`,f).success(function(n){sparePartsSelected=!1;$("#product").select2("destroy");spareProductList=n.spareProducts;catLocation=`/SparePartsFinder/ShowSpareParts?CategoryId=${selectedCategoryState}&BrandId=${u}&ModelId=${r}`;var f=``;$("#prd-info").empty();$.each(n.spareProducts,function(n,t){f+=``;$("#prd-info").append(i(t))});$("#product").empty();$("#product").html(f);$("#product").select2({templateResult:t,closeOnSelect:!1});$("#brand").val(n.brand).trigger("change.select2");$("#specification").val("").trigger("change.select2")}))});$("#specification").on("change",function(){var r,u;(sparePartsSelected=!1,r=$("#specification").val(),r!=""&&r!=0)&&(u={Specification:r,CategoryId:selectedCategoryState},displayAjaxLoading(!0),n(`get-spare-products-by-specification`,u).success(function(n){$("#product").select2("destroy");spareProductList=n.spareProducts;catLocation=`/spare-parts-finder/show-spare-products?CategoryId=${selectedCategoryState}&Specification=${r}`;var u=``;$("#prd-info").empty();$.each(n.spareProducts,function(n,t){u+=``;$("#prd-info").append(i(t))});$("#product").empty();$("#product").html(u);$("#product").select2({templateResult:t,closeOnSelect:!1})}))});$("#product").on("select2:selecting",function(n){var r,t,u,e;if(sparePartsSelected||$("#prd-info").empty(),sparePartsSelected=!0,r=n.params.args,t=n.params.args.data.id,t==-1||t==null||t==""){window.location=catLocation;return}let f=spareProductList.find(n=>n.Id==t);$("#prd-info").append(i(f));$(r.originalEvent.target).hasClass("addToCartCheckbox")&&(u="/addproducttocart/catalog/"+t+"/1/1",AjaxCart.addproducttocart_catalog(u));e={CategoryId:selectedCategoryState,ProductId:t}});$("#product").on("select2:unselecting",function(n){var t=n.params.args.data.id;$(`#prd-${t}`).remove()})})Instance ID Token
Needs Permission
Can't find what you are looking for?
Click Here to Contact Us or call our friendly team on 0800 699 353.