PageSourceSearch

https://www.morfurniture.com/cdn/shop/t/75/assets/recommend-produc…?v=50214135341008435521786383431

js morfurniture.com collected 2026-09-26 04:28:18 UTC 5,058 bytes, 2 lines download raw bytes

1class RecommendProductsByName extends HTMLElement{constructor(){super(),this.init()}getCurrentStoreCode(){this.storeCode=getCookie("mor_store_code")||"00"}renderProducts(productItems){this.querySelector(".recommended-products__wrapper").innerHTML="",productItems.forEach(item=>{const itemTitle=item.title;if(itemTitle&&itemTitle.trim&&itemTitle.trim()===this.dataset.productTitle.trim()||!itemTitle||itemTitle.split(" ")[0].toLowerCase()!==this.dataset.productTitle.split(" ")[0].toLowerCase())return;const productTemplate=this.productCardTemplate.cloneNode(!0);if(productTemplate.querySelector(".more-in-collection__title-link").textContent=itemTitle,!item.productUrl)return;productTemplate.querySelector(".more-in-collection__link").setAttribute("href",item.productUrl),productTemplate.querySelector(".more-in-collection__title-link").setAttribute("href",item.productUrl);let firstImage="";item.imageUrl&&item.imageUrl[0]&&(firstImage=item.imageUrl[0],productTemplate.querySelector(".more-in-collection__image").setAttribute("src",firstImage));const hoverImageDom=productTemplate.querySelector(".more-in-collection__image--hover");let secondImage="";hoverImageDom&&(item.imageUrl&&item.imageUrl[1]?(secondImage=item.imageUrl[1],hoverImageDom.setAttribute("src",secondImage)):hoverImageDom.remove());const storesPriceString=item.variants&&item.variants[0]&&item.variants[0].v_meta_location_info_pricing_only,storesPrice=storesPriceString?JSON.parse(storesPriceString):null;if(!storesPrice)return;let priceToDisplay="";this.storeCode||this.getCurrentStoreCode();const matchedData=storesPrice[this.storeCode]||null;if(["8615068500158","8615068238014","8615068172478","8615068139710","8615068106942","8615066796222","8615066697918","8615066632382","8615066534078"].includes(item.uniqueId))priceToDisplay='<span data-store-price-value="" data-fixed-see-price-in-cart>See Price in Cart</span>';else{const{webPrice,regionPrice,mapPrice}=matchedData,onSale=item.meta_on_sale==="true";mapPrice>webPrice?priceToDisplay='<span data-store-price-value="">See Price in Cart</span>':onSale&&webPrice<regionPrice?priceToDisplay=`<span data-store-price-value="">${formatPrice(webPrice)} </span><span data-store-original-price-value="">${formatPrice(regionPrice)}</span>`:onSale&&webPrice>=regionPrice?priceToDisplay=`<span data-store-price-value="">${formatPrice(webPrice)}</span>`:priceToDisplay=`<span data-store-price-value="">${formatPrice(webPrice)}</span>`}productTemplate.querySelector(".more-in-collection__price").innerHTML=priceToDisplay;const productForm=productTemplate.querySelector("product-form");productForm&&(item.variants&&item.variants[0]&&item.variants[0].variantId?(productForm.querySelector('input[name="product-id"]').value=item.uniqueId,productForm.querySelector('input[name="id"]').value=item.variants&&item.variants[0]&&item.variants[0].variantId):productForm.remove());const productCollection=productTemplate.querySelector("product-collect");productCollection&&(item.handle&&item.imageUrl&&item.imageUrl[0]&&item.variants&&item.variants[0]&&item.variants[0].variantId?(productCollection.setAttribute("product-handle",item.handle),productCollection.setAttribute("product-img",item.imageUrl[0]||""),productCollection.setAttribute("product-title",item.title),productCollection.setAttribute("product-variant-id",item.variants&&item.variants[0]&&item.variants[0].variantId),productC
1ollection.setAttribute("product-url",item.productUrl)):productCollection.remove());const quickViewBtuuon=productTemplate.querySelector("quick-view");quickViewBtuuon&&quickViewBtuuon.setAttribute("data-product-url",item.productUrl),this.querySelector(".recommended-products__wrapper").appendChild(productTemplate)}),this.querySelector(".recommended-products__wrapper").children.length>0&&this.closest(".shopify-section").classList.remove("hidden")}init(){const productTitle=this.dataset.productTitle;if(!productTitle)return;const firstWord=productTitle.split(" ")[0].toLowerCase();this.productCardTemplate=this.querySelector("template[data-recommendation-template]").content,fetch(`https://search.unbxd.io/9fb669917c94af22dab7c999739128bd/ss-unbxd-aus-shopify-morfurniture-com811551761318384/search?q=${firstWord}&facet.multiselect=true&variants=true&variants.fields=v_meta_location_info_pricing_only&variants.fields=variantId&variants.count=50&fields=title,uniqueId,productUrl,handle,imageUrl,price,variantCount,variants,meta_on_sale&spellcheck=true&rows=50&start=0&version=V2&filter=v_regionallyAvailable_XX:%22Y%22&fallback=true&fallback.method=maxAllowedFilters=1&facet.version=V2`).then(response=>response.text()).then(result=>{const parseredResult=JSON.parse(result),productItems=parseredResult.response.products;console.log("parseredResult",parseredResult),productItems.length&&this.renderProducts(productItems)}).catch(error=>console.error("Error fetching products:",error))}}customElements.define("recommend-products-by-name",RecommendProductsByName);
2//# sourceMappingURL=/cdn/shop/t/75/assets/recommend-products-by-name.js.map?v=50214135341008435521786383431

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.