PageSourceSearch

https://sundryclothing.com/cdn/shop/t/228/assets/pdp-related-prods.js?v=162585935770126914301764790107

js sundryclothing.com collected 2026-09-25 18:37:34 UTC 24,319 bytes, 2 lines download raw bytes

1function getDistinct(t){let e=[],n={};for(let i2 in t)objTitle=t[i2].id,n[objTitle]=t[i2];for(i in n)e.push(n[i]);return e}var final_count=0,related_eles=[],already_added=[],total_required=4,total_added=0,total_remains=0,getCombn=function(a,min=1){for(var fn=function(n,src,got,all2){if(n==0){got.length>0&&(all2[all2.length]=got);return}for(var j=0;j<src.length;j++)fn(n-1,src.slice(j+1),got.concat([src[j]]),all2)},all=[],i2=min;i2<a.length;i2++)fn(i2,a,[],all);return all.push(a),all},global_counter=0;function fetchRelatedProds(prod_type,color,pfabric,prod_handle,full_price){var url="/collections/all?view=ajax&time="+new Date().getTime();fetch(url).then(function(response){return response.text()}).then(function(html){var count=$(html).find("#bc-sf-filter-products").find('.thumbnail[data-available="true"][data-handle !="'+prod_handle+'"]').length,products=$(html).find("#bc-sf-filter-products").find('.thumbnail[data-available="true"][data-handle !="'+prod_handle+'"]');if($.each(products,function(i2,ele){var prod={handle:$(ele).attr("data-handle"),data_full_price:$(ele).attr("data-full-price"),product_type:$(ele).attr("data-prod_type"),color:$(ele).attr("data-color"),fabric:$(ele).attr("data-fabric"),element:ele};$(ele).attr("data-full-price")=="true"&&fullPriceProducts.push(prod),$(ele).attr("data-full-price")=="false"&&saleProducts.push(prod)}),full_price==!0){if(prod_type!=null&&color!=null&&pfabric!=null){var temp=$(html).find("#bc-sf-filter-products").find('.thumbnail[data-available="true"][data-handle !="'+prod_handle+'"][data-prod_type="'+prod_type+'"][data-color="'+color+'"][data-fabric="'+pfabric+'"]');temp.length>0&&($.each(temp,function(i2,ele){var prod={handle:$(ele).attr("data-handle"),full_price:$(ele).attr("data-full-price"),product_type:$(ele).attr("data-prod_type"),color:$(ele).attr("data-color"),fabric:$(ele).attr("data-fabric"),element:ele},found2=!1;if($.each(final_products,function(ind,val){if(val.handle==$(ele).attr("data-handle"))return found2=!0,!1}),found2==!1&&($(ele).attr("data-full-price")=="true"&&final_products.push(prod),final_products.length>=4))return!1}),temp.length<4&&$.each(temp,function(i2,ele){var prod={handle:$(ele).attr("data-handle"),full_price:$(ele).attr("data-full-price"),product_type:$(ele).attr("data-prod_type"),color:$(ele).attr("data-color"),fabric:$(ele).attr("data-fabric"),element:ele},found2=!1;if($.each(final_products,function(ind,val){if(val.handle==$(ele).attr("data-handle"))return found2=!0,!1}),found2==!1&&($(ele).attr("data-full-price")=="false"&&final_products.push(prod),final_products.length>=4))return!1}))}if(final_products.length<4&&prod_type!=null&&pfabric!=null){var temp=$(html).find("#bc-sf-filter-products").find('.thumbnail[data-available="true"][data-handle !="'+prod_handle+'"][data-prod_type="'+prod_type+'"][data-fabric="'+pfabric+'"]');temp.length>0&&($.each(temp,function(i2,ele){var prod={handle:$(ele).attr("data-handle"),full_price:$(ele).attr("data-full-price"),product_type:$(ele).attr("data-prod_type"),color:$(ele).attr("data-color"),fabric:$(ele).attr("data-fabric"),element:ele},found2=!1;if($.each(final_products,function(ind,val){if(val.handle==$(ele).attr("data-handle"))return found2=!0,!1}),found2==!1&&($(ele).attr("data-full-price")=="true"&&final_products.push(prod),final_products.length>=4))return!1}),temp.length<4&&$.each(temp,function(i2,ele){var prod={handle:$(ele).attr("data-handle"),full_price:$(ele).attr("data-full-price"),product_type:$(ele).attr("data-prod_type"),color:$(ele).attr("data-color"),fabric:$(ele).attr("data-fabric"),element:ele},found2=!1;if($.each(final_products,function(ind,val){if(val.handle==$(ele).attr("data-handle"))return found2=!0,!1}),found2==!1&&($(ele).attr("data-full-price")=="false"&&final_products.push(prod),final_products.length>=4))return!1}))}if(final_products.length<4&&prod_type!=null&&color!=null){var temp=$(html).find("#bc-sf-filter-products").find('.thumbnail[data-available="true"][data-handle !="'+prod_handle+'"][data-prod_type="'+prod_type+'"][data-color="'+color+'"]');temp.length>0&&$.each(temp,function(i2,ele){var prod={handle:$(ele).attr("data-handle"),full_price:$(ele).attr("data-full-price"),product_type:$(ele).attr("data-prod_type"),color:$(ele).attr("data-color"),fabric:$(ele).attr("data-fabric"),element:ele},found2=!1;if($.each(final_products,function(ind,val){if(val.handle==$(ele).attr("data-handle"))return found2=!0,!1}),found2==!1&&($(ele).attr("data-full-price")=="true"&&final_products.push(prod),final_products.length>=4))return!1}),temp.length<4&&$.each(temp,function(i2,ele){var prod={handle:$(ele).attr("data-handle"),full_price:$(ele).attr("data-full-price"),product_type:$(ele).attr("data-prod_type"),color:$(ele).attr("data-color"),fabric:$(ele).attr("data-fabric"),element:ele},found2=!1;if($.each(final_products,function(ind,val){if(val.handle==$(ele).attr("data-handle"))return found2=!0,!1}),found2==!1&&($(ele).attr("data-full-price")=="false"&&final_products.push(prod),final_products.length>=4))return!1})}if(final_products.length<4&&prod_type!=null){var temp=$(html).find("#bc-sf-filter-products").find('.thumbnail[data-available="true"][data-handle !="'+prod_handle+'"][data-prod_type="'+prod_type+'"]');temp.length>0&&($.each(temp,function(i2,ele){var prod={handle:$(ele).attr("data-handle"),full_price:$(ele).attr("data-full-price"),product_type:$(ele).attr("data-prod_type"),color:$(ele).attr("data-color"),fabric:$(ele).attr("data-fabric"),element:ele},found2=!1;if($.each(final_products,function(ind,val){if(val.handle==$(ele).attr("data-handle"))return found2=!0,!1}),found2==!1&&($(ele).attr("data-full-price")=="true"&&final_products.push(prod),final_products.length>=4))return!1}),temp.length<4&&$.each(temp,function(i2,ele){var prod={handle:$(ele).attr("data-handle"),full_price:$(ele).attr("data-full-price"),product_type:$(ele).attr("data-prod_type"),color:$(ele).attr("data-color"),fabric:$(ele).attr("data-fabric"),element:ele},found2=!1;if($.each(final_products,function(ind,val){if(val.handle==$(ele).attr("data-handle"))return found2=!0,!1}),found2==!1&&($(ele).attr("data-full-price")=="false"&&final_products.push(prod),final_products.length>=4))return!1}))}
1if(final_products.length<4&&color!=null){var temp=$(html).find("#bc-sf-filter-products").find('.thumbnail[data-available="true"][data-handle !="'+prod_handle+'"][data-color="'+color+'"]');temp.length>0&&($.each(temp,function(i2,ele){var prod={handle:$(ele).attr("data-handle"),full_price:$(ele).attr("data-full-price"),product_type:$(ele).attr("data-prod_type"),color:$(ele).attr("data-color"),fabric:$(ele).attr("data-fabric"),element:ele},found2=!1;if($.each(final_products,function(ind,val){if(val.handle==$(ele).attr("data-handle"))return found2=!0,!1}),found2==!1&&($(ele).attr("data-full-price")=="true"&&final_products.push(prod),final_products.length>=4))return!1}),temp.length<4&&$.each(temp,function(i2,ele){var prod={handle:$(ele).attr("data-handle"),full_price:$(ele).attr("data-full-price"),product_type:$(ele).attr("data-prod_type"),color:$(ele).attr("data-color"),fabric:$(ele).attr("data-fabric"),element:ele},found2=!1;if($.each(final_products,function(ind,val){if(val.handle==$(ele).attr("data-handle"))return found2=!0,!1}),found2==!1&&($(ele).attr("data-full-price")=="false"&&final_products.push(prod),final_products.length>=4))return!1}))}if(final_products.length<4&&pfabric!=null){var temp=$(html).find("#bc-sf-filter-products").find('.thumbnail[data-available="true"][data-handle !="'+prod_handle+'"][data-fabric="'+pfabric+'"]');temp.length>0&&($.each(temp,function(i2,ele){var prod={handle:$(ele).attr("data-handle"),full_price:$(ele).attr("data-full-price"),product_type:$(ele).attr("data-prod_type"),color:$(ele).attr("data-color"),fabric:$(ele).attr("data-fabric"),element:ele},found2=!1;if($.each(final_products,function(ind,val){if(val.handle==$(ele).attr("data-handle"))return found2=!0,!1}),found2==!1&&($(ele).attr("data-full-price")=="true"&&final_products.push(prod),final_products.length>=4))return!1}),temp.length<4&&$.each(temp,function(i2,ele){var prod={handle:$(ele).attr("data-handle"),full_price:$(ele).attr("data-full-price"),product_type:$(ele).attr("data-prod_type"),color:$(ele).attr("data-color"),fabric:$(ele).attr("data-fabric"),element:ele},found2=!1;if($.each(final_products,function(ind,val){if(val.handle==$(ele).attr("data-handle"))return found2=!0,!1}),found2==!1&&($(ele).attr("data-full-price")=="false"&&final_products.push(prod),final_products.length>=4))return!1}))}var temp=$(html).find("#bc-sf-filter-products").find('.thumbnail[data-available="true"][data-handle !="'+prod_handle+'"]');if(temp.length>0&&$.each(products,function(i2,ele){var prod={handle:$(ele).attr("data-handle"),full_price:$(ele).attr("data-full-price"),product_type:$(ele).attr("data-prod_type"),color:$(ele).attr("data-color"),fabric:$(ele).attr("data-fabric"),element:ele};$(ele).attr("data-full-price")=="true"&&random_prods.push(prod)}),final_products.length>=4)showRelatedSection(final_products);else{var remain=4-final_products.length;showRelatedSectionRandom(random_prods,remain)}}else{if(final_products.length<4&&pfabric!=null){var found=!1,temp=$(html).find("#bc-sf-filter-products").find('.thumbnail[data-available="true"][data-handle !="'+prod_handle+'"][data-fabric="'+pfabric+'"]');temp.length>0&&$.each(temp,function(i2,ele){var prod={handle:$(ele).attr("data-handle"),full_price:$(ele).attr("data-full-price"),product_type:$(ele).attr("data-prod_type"),color:$(ele).attr("data-color"),fabric:$(ele).attr("data-fabric"),element:ele},found2=!1;if($.each(final_products,function(ind,val){if(val.handle==$(ele).attr("data-handle"))return found2=!0,!1}),found2==!1&&final_products.push(prod),final_products.length>=4)return!1})}if(final_products.length<4&&prod_type!=null&&color!=null){var found=!1,temp=$(html).find("#bc-sf-filter-products").find('.thumbnail[data-available="true"][data-handle !="'+prod_handle+'"][data-prod_type="'+prod_type+'"][data-color="'+color+'"]');temp.length>0&&$.each(temp,function(i2,ele){var found2=!1,prod={handle:$(ele).attr("data-handle"),full_price:$(ele).attr("data-full-price"),product_type:$(ele).attr("data-prod_type"),color:$(ele).attr("data-color"),fabric:$(ele).attr("data-fabric"),element:ele};if($.each(final_products,function(ind,val){if(val.handle==$(ele).attr("data-handle"))return found2=!0,!1}),found2==!1&&final_products.push(prod),final_products.length>=4)return!1})}if(final_products.length<4&&prod_type!=null){var temp=$(html).find("#bc-sf-filter-products").find('.thumbnail[data-available="true"][data-handle !="'+prod_handle+'"][data-prod_type="'+prod_type+'"]');temp.length>0&&$.each(temp,function(i2,ele){var prod={handle:$(ele).attr("data-handle"),full_price:$(ele).attr("data-full-price"),product_type:$(ele).attr("data-prod_type"),color:$(ele).attr("data-color"),fabric:$(ele).attr("data-fabric"),element:ele},found2=!1;if($.each(final_products,function(ind,val){if(val.handle==$(ele).attr("data-handle"))return found2=!0,!1}),found2==!1&&final_products.push(prod),final_products.length>=4)return!1})}var temp=$(html).find("#bc-sf-filter-products").find('.thumbnail[data-available="true"][data-handle !="'+prod_handle+'"]');
1if(temp.length>0&&$.each(products,function(i2,ele){var prod={handle:$(ele).attr("data-handle"),full_price:$(ele).attr("data-full-price"),product_type:$(ele).attr("data-prod_type"),color:$(ele).attr("data-color"),fabric:$(ele).attr("data-fabric"),element:ele};random_prods.push(prod)}),final_products.length>=4)showRelatedSection(final_products,prod_type);else{var remain=4-final_products.length;showRelatedSectionRandom(final_products,random_prods,remain)}}}).catch(function(err){console.log("Failed to fetch page: ",err)})}function shuffle(array){for(var currentIndex=array.length,temporaryValue,randomIndex;currentIndex!==0;)randomIndex=Math.floor(Math.random()*currentIndex),currentIndex-=1,temporaryValue=array[currentIndex],array[currentIndex]=array[randomIndex],array[randomIndex]=temporaryValue;return array}function appendRemaingProds(data,limit){var related_eles2=data,fi;$.each(related_eles2,function(ind,val){var found=!1;for(fi=0;fi<already_added.length;fi++)already_added[fi].handle==$(val.element).attr("data-handle")&&(found=!0);if(found==!1&&(total_remains++,$(val.element).removeAttr("style"),$("#similar_products #bc-sf-filter-products").append(val.element)),total_remains==limit)return!1})}function showRelatedSection(data,prod_type){var related_eles2=data,fi;$.each(related_eles2,function(ind,val){var pair_found=!1;for(fi=0;fi<pdp_pairwith.length;fi++)pdp_pairwith[fi]==$(val.element).attr("data-handle")&&(pair_found=!0);if(pair_found==!1&&(total_added++,$(val.element).removeAttr("style"),already_added.push(val),$("#similar_products #bc-sf-filter-products").append(val.element)),total_added==4)return!1});var remain2=4-total_added;if(remain2>0){var d=$.grep(random_prods,function(n,i2){return n.product_type==prod_type});appendRemaingProds(d,remain2)}$("#bc-sf-filter-products").removeClass("one_element two_element three_element four_element");var total_similars=$("#bc-sf-filter-products .thumbnail").length;total_similars==1?$("#bc-sf-filter-products").addClass("one_element"):total_similars==2?$("#bc-sf-filter-products").addClass("two_element"):total_similars==3?$("#bc-sf-filter-products").addClass("three_element"):$("#bc-sf-filter-products").addClass("four_element"),$("#similar_products").removeClass("hidden")}function showRelatedSectionRandom(final_products2,data,remain){shuffle(data);var related_eles2=data,fi,fi2;$.each(final_products2,function(ind,val){var pair_found=!1;for(fi=0;fi<pdp_pairwith.length;fi++)pdp_pairwith[fi]==$(val.element).attr("data-handle")&&(pair_found=!0);pair_found==!1&&($(val.element).removeAttr("style"),$("#similar_products #bc-sf-filter-products").append(val.element))});var final_len=(final_products2.length-4)*-1;$.each(related_eles2,function(ind,val){var pair_found=!1;for(fi2=0;fi2<pdp_pairwith.length;fi2++)pdp_pairwith[fi2]==$(val.element).attr("data-handle")&&(pair_found=!0);if(pair_found==!1&&(total_added++,$(val.element).removeAttr("style"),$("#similar_products #bc-sf-filter-products").append(val.element)),total_added==final_len)return!1}),$("#bc-sf-filter-products").removeClass("one_element two_element three_element four_element");var total_similars=$("#bc-sf-filter-products .thumbnail").length;total_similars==1?$("#bc-sf-filter-products").addClass("one_element"):total_similars==2?$("#bc-sf-filter-products").addClass("two_element"):total_similars==3?$("#bc-sf-filter-products").addClass("three_element"):$("#bc-sf-filter-products").addClass("four_element"),$("#similar_products").removeClass("hidden")}var saleProducts=[],fullPriceProducts=[],final_products=[],random_prods=[];function recursively_ajax(selectedOptions,prod_handle,full_price,ptype=null,pfabric=null){var t=selectedOptions,final_options=t.join("+"),path=final_options,d=new Date().getTime();$.ajax({type:"GET",async:"false",url:"/collections/all/"+path+"?view=ajax&time="+d,success:function(data){var html=$(data),count=html.find("#bc-sf-filter-products").find('.thumbnail[data-available="true"][data-handle !="'+prod_handle+'"][data-full-price="true"]').length;if(full_price==!1&&(count=html.find("#bc-sf-filter-products").find('.thumbnail[data-available="true"][data-handle !="'+prod_handle+'"][data-full-price="false"]').length),count<4&&ptype!=null&&selectedOptions.indexOf(ptype)>=0&&pfabric!=null&&selectedOptions.indexOf(pfabric)>=0){console.log(ptype,pfabric),console.log("1st ccount 4");var fixed_options=[];fixed_options.push(ptype),fixed_options.push(pfabric),recursively_ajax(fixed_options,prod_handle,full_price,null,null)}if(count<4){var prod_data=html.find("#bc-sf-filter-products").find('.thumbnail[data-available="true"][data-handle !="'+prod_handle+'"][data-full-price="true"]');if(full_price==!1){var prod_data2=html.find("#bc-sf-filter-products").find('.thumbnail[data-available="true"][data-handle !="'+prod_handle+'"][data-full-price="false"]'),fi;$.each(prod_data2,function(i2,ele){var pair_found=!1;for(fi=0;fi<pdp_pairwith.length;fi++)pdp_pairwith[fi]==$(ele).attr("data-handle")&&(pair_found=!0);if(pair_found==!1){var found=!1;$.each(saleProducts,function(ind,val){if(val.handle==$(ele).attr("data-handle"))return found=!0,!1}),found==!1&&saleProducts.push({handle:$(ele).attr("data-handle"),element:ele})}})}var fi;$.each(prod_data,function(i2,ele){var pair_found=!1;for(fi=0;fi<pdp_pairwith.length;fi++)pdp_pairwith[fi]==$(ele).attr("data-handle")&&(pair_found=!0);if(pair_found==!1){final_count++;var found=!1;$.each(related_eles,function(ind,val){if(val.handle==$(ele).attr("data-handle"))return found=!0,!1}),found==!1&&related_eles.push({handle:$(ele).attr("data-handle"),element:ele})}pair_found==!1&&fullPriceProducts.push({handle:$(ele).attr("data-handle"),element:ele})});var newOptions=selectedOptions.pop();recursively_ajax(selectedOptions,prod_handle,full_price,null,null)}else{var prod_data=html.find("#bc-sf-filter-products").find('.thumbnail[data-available="true"][data-handle !="'+prod_handle+'"][data-full-price="true"]'),total=html.find("#bc-sf-filter-products").find('.thumbnail[data-available="true"][data-handle !="'+prod_handle+'"][data-full-price="true"]').length;if(full_price==!1){var prod_data2=html.find("#bc-sf-filter-products").find('.thumbnail[data-available="true"][data-handle !="'+prod_handle+'"][data-full-price="false"]'),fi;$.each(prod_data2,function(i2,ele){var pair_found=!1;for(fi=0;fi<pdp_pairwith.length;fi++)pdp_pairwith[fi]==$(ele).attr("data-handle")&&(pair_found=!0);if(pair_found==!1){var found=!1;$.each(saleProducts,function(ind,val){if(val.handle==$(ele).attr("data-handle"))return found=!0,!1}),found==!1&&saleProducts.push({handle:$(ele).attr("data-handle"),element:ele})}})}var fi;$.each(prod_data,function(i2,ele){var pair_found=!1;for(fi=0;fi<pdp_pairwith.length;fi++)pdp_pairwith[fi]==$(ele).attr("data-handle")&&(pair_found=!0);if(pair_found==!1){final_count++;var found=!1;if($.each(related_eles,function(ind,val){if(val.handle==$(ele).attr("data-handle"))return found=!0,!1}),found==!1&&related_eles.push({handle:$(ele).attr("data-handle"),element:ele}),final_count>=4)return!1}pair_found==!1&&fullPriceProducts.push({handle:$(ele).attr("data-handle"),element:ele})}),$.each(related_eles,function(ind,val){$(val.element).removeAttr("style"),$("#similar_products #bc-sf-filter-products").append(val.element)}),$("#bc-sf-filter-products").removeClass("one_element two_element three_element four_element");var total_similars=$("#bc-sf-filter-products .thumbnail").length;total_similars==1?$("#bc-sf-filter-products").addClass("one_element"):total_similars==2?$("#bc-sf-filter-products").addClass("two_element"):total_similars==3?$("#bc-sf-filter-products").addClass("three_element"):$("#bc-sf-filter-products").addClass("four_element"),$("#similar_products").removeClass("hidden")}}})}function getRelatedProds2(selectedOptions,prod_handle,full_price,ptype=null,pfabric=null){var t=selectedOptions,final_options=t.join("+"),path=final_options;$.ajax({type:"GET",async:"false",url:"/collections/all/"+path+"?view=ajax&time="+new Date().getTime(),success:function(data){var html=$(data),count=html.find("#bc-sf-filter-products").find('.thumbnail[data-available="true"][data-handle !="'+prod_handle+'"]').length,fi,result_prods=html.find("#bc-sf-filter-products").find('.thumbnail[data-available="true"][data-handle !="'+prod_handle+'"]'),full_count2=0,sale_count2=0;$.each(result_prods,function(i2,ele){var found=!1;if($(ele).attr("data-full-price")=="true"&&($.each(fullPriceProducts,function(ind,val){if(val.handle==$(ele).attr("data-handle"))return found=!0,!1}),found==!1&&(full_count2++,fullPriceProducts.push({handle:$(ele).attr("data-handle"),element:ele})),full_count2>=4))return!1;if($(ele).attr("data-full-price")=="false"&&fullPriceProducts.length<4){var found2=!1;if($.each(saleProducts,function(ind,val){if(val.handle==$(ele).attr("data-handle"))return found2=!0,!1}),found2==!1&&(sale_count2++,saleProducts.push({handle:$(ele).attr("data-handle"),element:ele})),sale_count2>=4)return!1}})}})}function getRelatedProds(selectedOptions,prod_handle,full_price,ptype,pfabric){if(full_price==!0){var t=selectedOptions,final_options=t.join("+"),path=final_options;$.ajax({type:"GET",url:"/collections/all/"+path+"?view=ajax&time="+new Date().getTime(),success:function(data){var html=$(data),count=html.find("#bc-sf-filter-products").find('.thumbnail[data-available="true"][data-handle !="'+prod_handle+'"]').length,fi,result_prods=html.find("#bc-sf-filter-products").find('.thumbnail[data-available="true"][data-handle !="'+prod_handle+'"]'),full_count2=0,sale_count2=0;if(selectedOptions.length>0){if($.each(result_prods,function(i2,ele){var found=!1;if($(ele).attr("data-full-price")=="true"&&($.each(fullPriceProducts,function(ind,val){if(val.handle==$(ele).attr("data-handle"))return found=!0,!1}),found==!1&&(full_count2++,fullPriceProducts.push({handle:$(ele).attr("data-handle"),element:ele})),full_count2>=4))return!1;if($(ele).attr("data-full-price")=="false"&&fullPriceProducts.length<4){var found2=!1;if($.each(saleProducts,function(ind,val){if(val.handle==$(ele).attr("data-handle"))return found2=!0,!1}),found2==!1&&(sale_count2++,saleProducts.push({handle:$(ele).attr("data-handle"),element:ele})),sale_count2>=4)return!1}}),ptype!=null&&selectedOptions.indexOf(ptype)>=0&&pfabric!=null&&selectedOptions.indexOf(pfabric)>=0){var t2=[];t2.push(ptype),t2.push(pfabric),getRelatedProds2(t2,prod_handle,full_price,null,null)}if(fullPriceProducts.length<=4){var newOptions=selectedOptions.pop();getRelatedProds(selectedOptions,prod_handle,full_price,null,null)}}}}).done(function(data){var html=$(data),result_prods=html;$.each(result_prods,function(i2,ele){var found=!1;if($(ele).attr("data-full-price")=="true"&&($.each(fullPriceProducts,function(ind,val){if(val.handle==$(ele).attr("data-handle"))return found=!0,!1}),found==!1&&(full_count++,random_prods.push({handle:$(ele).attr("data-handle"),element:ele}))),$(ele).attr("data-full-price")=="false"&&fullPriceProducts.length<4){var found2=!1;$.each(saleProducts,function(ind,val){if(val.handle==$(ele).attr("data-handle"))return found2=!0,!1}),found2==!1&&(sale_count++,random_prods.push({handle:$(ele).attr("data-handle"),element:ele}))}}),fullPriceProducts.length<4?final_products=fullPriceProducts.concat(saleProducts):final_products=fullPriceProducts,final_products.length>0&&showRelatedSection(final_products,4)})}else{var t=selectedOptions,final_options=t.join("+"),path=final_options;$.ajax({type:"GET",async:"false",url:"/collections/all/"+path+"?view=ajax&time="+new Date().getTime(),success:function(data){var html=$(data),count=html.find("#bc-sf-filter-products").find('.thumbnail[data-available="true"][data-handle !="'+prod_handle+'"]').length,fi,result_prods=html.find("#bc-sf-filter-products").find('.thumbnail[data-available="true"][data-handle !="'+prod_handle+'"]'),full_count2=0,sale_count2=0;if($.each(result_prods,function(i2,ele){var found=!1;if($(ele).attr("data-full-price")=="true"&&($.each(fullPriceProducts,function(ind,val){if(val.handle==$(ele).attr("data-handle"))return found=!0,!1}),found==!1&&(full_count2++,fullPriceProducts.push({handle:$(ele).attr("data-handle"),element:ele})),full_count2>=4))return!1;if($(ele).attr("data-full-price")=="false"){var found2=!1;if($.each(saleProducts,function(ind,val){if(val.handle==$(ele).attr("data-handle"))return found2=!0,!1}),found2==!1&&(sale_count2++,saleProducts.push({handle:$(ele).attr("data-handle"),element:ele})),sale_count2>=4)return!1}}),ptype!=null&&selectedOptions.indexOf(ptype)>=0&&pfabric!=null&&selectedOptions.indexOf(pfabric)>=0){var t2=[];t2.push(ptype),t2.push(pfabric),getRelatedProds2(t2,prod_handle,full_price,null,null)}if(fullPriceProducts.length<=4){var newOptions=selectedOptions.pop();getRelatedProds(selectedOptions,prod_handle,full_price,null,null)}if(saleProducts.length>=4)final_products.contact(saleProducts);else{var d=saleProducts.concat(fullPriceProducts);final_products=d}final_products.length>0&&(console.log(final_products),showRelatedSection(final_products,4))}})}}
2//# sourceMappingURL=/cdn/shop/t/228/assets/pdp-related-prods.js.map?v=162585935770126914301764790107

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.