[]
767) { wrap.scrollLeft = (wrap.scrollWidth – wrap.clientWidth ) / 2; } else { wrap.scrollLeft = ((wrap.scrollWidth – wrap.clientWidth ) / 2) + 6; } }); function bcscroll(e,d,tileWidth) { let contentWidth = ($(“#” + e).find(“.grid__item_tile”).length / 2) * tileWidth; var maxScroll = contentWidth – $(“#” + e).width() – 46; let dir = d + “=” + $(“#” + e).width(); $(“#” + e).animate({ scrollLeft: dir }, 500, “swing”, function () { if ($(“#” + e).scrollLeft() > 0) { $(“#” + e).parent().find(“.hpbc-arrowLeft”).show(); $(“#” + e).parent().find(“.hpbc-arrowLeft-disabled”).hide(); } else { $(“#” + e).parent().find(“.hpbc-arrowLeft”).hide(); $(“#” + e).parent().find(“.hpbc-arrowLeft-disabled”).show(); } if ($(“#” + e).scrollLeft() >= maxScroll) { $(“#” + e).parent().find(“.hpbc-arrowRight”).hide(); $(“#” + e).parent().find(“.hpbc-arrowRight-disabled”).show(); } else { $(“#” + e).parent().find(“.hpbc-arrowRight”).show(); $(“#” + e).parent().find(“.hpbc-arrowRight-disabled”).hide(); } }); } ]]>

    The Celebration Continues

    Save Up to 90% Off

    SHOP NOW

    The Celebration Continues

    Save Up to 90% Off

    Up to 85% Off

    + Extra Savings

    Great Gifts For Anyone & Any Budget

    + Free Shipping

    SHOP NOW

    Great Gifts For Anyone & Any Budget

    + Free Shipping

0) { $(“#” + e).parent().find(“.hpbc-arrowLeft”).show(); $(“#” + e).parent().find(“.hpbc-arrowLeft-disabled”).hide(); } else { $(“#” + e).parent().find(“.hpbc-arrowLeft”).hide(); $(“#” + e).parent().find(“.hpbc-arrowLeft-disabled”).show(); } if ($(“#” + e).scrollLeft() >= maxScroll) { $(“#” + e).parent().find(“.hpbc-arrowRight”).hide(); $(“#” + e).parent().find(“.hpbc-arrowRight-disabled”).show(); } else { $(“#” + e).parent().find(“.hpbc-arrowRight”).show(); $(“#” + e).parent().find(“.hpbc-arrowRight-disabled”).hide(); } }); } ]]>

Deals on Thousands of Brands

Free Shipping & Easy Returns

Earn Points & Get Rewards

= maxScroll) { $(“#” + e).parent().find(“.hppromo-arrowRight”).hide(); $(“#” + e).parent().find(“.hppromo-arrowRight-disabled”).show(); } else { $(“#” + e).parent().find(“.hppromo-arrowRight”).show(); $(“#” + e).parent().find(“.hppromo-arrowRight-disabled”).hide(); } }); } ]]> Previous Next = totalSlides) { // Hide next arrow when there are no more slides to show $(‘.nextArrowElement’).hide(); } else { // Show next arrow when there are more slides to show $(‘.nextArrowElement’).show(); } }); } const faveHpStoreApi = {}; faveHpStoreApi.getProductByUrl = handle => { return fetch(“/products/” + handle + “.js”, { method: “GET”, headers: { “Content-Type”: “application/json”, } }).then((response) => { if (response.ok) { return response.json(); } }) }; document.querySelector(‘.hp-faves-container’).style.display = ‘none’; // get faves into carousel const getAllFavesHP = async (faveArr) => { let today = new Date().toLocaleDateString(); let parseToday = Date.parse(today); if (faveArr.length < 4) { document.querySelector('.hp-faves-container').style.display = 'none'; } if (faveArr.length < 6) { document.querySelector('.hp-faves-cta').style.display = 'none'; } let imageSize = "_335x"; if (window.innerWidth < 768) { imageSize = "_200x"; } for (let i = 0; i { let customerId = customerIDFave; if (typeof item != "undefined") { let productId = faveArr[i].productId; let link = `/products/${faveArr[i].handle}?cid=faveclick:hprec` let price; let priceStr; let imageUrl; if (item.variants.length > 1) { price = item.variants[0].price; imageUrl = item.variants[0].featured_image.src; for (let j = 0; j < item.variants.length; j++) { if (item.variants[j].price < price && item?.variants[j]?.featured_image && item.variants[j].available == true) { price = item.variants[j].price; imageUrl = item.variants[j].featured_image.src; } } } else { price = item.variants[0].price; imageUrl = item.variants[0]?.featured_image.src; } // Fall back to regular image if no variant image imageUrl = imageUrl || item.images[0]; //load smaller images, otherwise they are 2000x2000 imageUrl = imageUrl.replace(/(.[^.]*)$/, imageSize + "$1"); let luxe = "" if (item.tags.includes("brand-type_1")) { luxe = `LUXE` } else { delete luxe; } price = (price / 100.0).toFixed(2) priceStr = price.toString().replace(/B(?=(d{3})+(?!d))/g, ','); let comparePrice = ""; let comparePriceStr = ""; let discount = ""; let comparePriceNum = (item.compare_at_price / 100.0).toFixed(2); let numberComparePrice = Number(comparePriceNum); let numberPrice = Number(price); if (numberComparePrice > numberPrice) { comparePriceStr = “$” + comparePriceNum.replace(/B(?=(d{3})+(?!d))/g, ‘,’); comparePrice = “$” + comparePriceNum discount = Math.round(((comparePriceNum – price) * 100) / comparePriceNum) + ‘%’; } else { comparePriceStr = “”; discount = “”; } let brand = “”; for (let m = 0; m < item.tags.length; m++) { if (item.tags[m].includes("brand_")) { let tag = item.tags[m]; brandArray = tag.split("_"); brand = brandArray[1]; } else { delete brand; } } let deal = ""; for (let k = 0; k = promoStart && parseToday < promoEnd) { deal = `${dealArray[1]}]]>` } } else { delete deal; } } let preOwned = “”; for (let j = 0; j < item.tags.length; j++) { if (item.tags[j].includes("product-condition_Preowned")) { let tag = item.tags[j]; comparePriceStr = ""; discount = ""; preOwned = '

PRELOVED

‘; break; } else { delete preOwned; } } let finalSale = “”; if (item.tags.includes(“NotReturnable”)) { finalSale = ‘

FINAL SALE

‘; } else { delete finalSale; } let removeHeart = ” let hpFavesCarWrap = document.querySelector(‘.hp-faves-car-wrap’) let hpFaveItem = document.createElement(‘div’); hpFaveItem.className = ‘hp-faves-item’; hpFaveItem.id = `hp-faves-item-${productId}` hpFaveItem.innerHTML = ` ${luxe}

${removeHeart}

${brand}

${item.title}

${deal}

$${priceStr}

${comparePriceStr}

${discount}

`; // hpFavesCarWrap.appendChild(hpFaveItem); let linkTag = document.createElement(‘a’); linkTag.setAttribute(‘href’, `${link}`); linkTag.appendChild(hpFaveItem); hpFavesCarWrap.appendChild(linkTag); } else { return; } }) // end of await .catch((err) => { console.log(err); }) } // end of for loop }; // removing a favorited item –> FUTURE FOLLOW UP // const removeHpFave = (el, custId, id) => { // event.preventDefault(); // event.stopPropagation(); // let custIdStr = custId.toString(); // let idStr = id.toString().toLowerCase(); // customerFavorites(“product”,”remove”,custIdStr,{“id”:idStr}) // .then((result) => { // if (result == “success”) // { // $(el).closest(“.hp-faves-item”).remove(); // } // else // { // fetchResults(false); // } // }) // .catch((err) => { // console.log(err); // }); // }

Discover curated styles and deals from your favorite brands and designers.

0) { $(“#” + e).parent().find(“.hp-col-arrowLeft”).show(); $(“#” + e).parent().find(“.hp-col-arrowLeft-disabled”).hide(); } else { $(“#” + e).parent().find(“.hp-col-arrowLeft”).hide(); $(“#” + e).parent().find(“.hp-col-arrowLeft-disabled”).show(); } if ($(“#” + e).scrollLeft() >= maxScroll) { $(“#” + e).parent().find(“.hp-col-arrowRight”).hide(); $(“#” + e).parent().find(“.hp-col-arrowRight-disabled”).show(); } else { $(“#” + e).parent().find(“.hp-col-arrowRight”).show(); $(“#” + e).parent().find(“.hp-col-arrowRight-disabled”).hide(); } }); } ]]>

Discover

Be inspired by styles & brands personalized for you!

{ let url = `https://spo-partner-api.azure-api.net/Discover?subscription-key=662cff71ce7d49088924abf032a0785c&page=1&brandTag=null&productTypeTag=null&genderTag=null&patternTag=null&styleTag=null&occasionTag=null&colorTag=null`; let genderTag = null; let productTypeTag = null; let brandTag = null; let styleTag = null; let occasionTag = null; let colorTag = null; let patternTag = null; if (customer) { const userId = window.dataLayerData.customer.id; fetch(`https://spo-partner-api.azure-api.net/personalization/v1/users/${userId}/style-preferences`, { method: ‘GET’, headers: { ‘Content-Type’: ‘application/json’, ‘Accept’: ‘application/json’, ‘Ocp-Apim-Subscription-Key’: ‘9f624633f2d34123aa12144e37dfdc0a’ } }) .then(res => res.json()) .then((res) => { if (res.length === 0) { $(‘.discovery-quiz-bar’).html(`Take our quiz for better recommendations & get 100 reward points!]]>Start`); let products = ”; const max = 2; let count = 0; let recentlyViewedProducts = getCookie(‘recentlyViewed’); if (recentlyViewedProducts == ”) { recentlyViewedProducts = []; } else { recentlyViewedProducts = JSON.parse(recentlyViewedProducts); } for (const product of recentlyViewedProducts) { if (product.id && product.id !== ” && max > count) { products += `${product.id}|`; count++; } } if (products.length > 0) { url += `&products=${encodeURIComponent(products)}`; } fetch(url, { method: ‘GET’, headers: { ‘Content-Type’: ‘application/json’, ‘Accept’: ‘application/json’, ‘Authorization’: `Bearer 1099c1c0a613651c486503c8c1b934` }, }) .then(res => res.json()) .then(data => addToFeed(data)); } else { $(‘.discovery-quiz-bar’).html(`

Styles based on your preferences

Retake Quiz`); for (const prompt of res) { if (prompt.promptId === ‘gender’) { const values = prompt.values.filter((option) => option.selected); genderTag = values.map(val => val.optionId).join(‘,’); if (genderTag === ‘menswear’) { genderTag = ‘men’; } else { genderTag = ‘women’; } } if (prompt.promptId === ‘additionalInterests’) { const values = prompt.values.filter((option) => option.selected); if (values.length > 0) { productTypeTag = values.map(val => val.optionId).join(‘,’); } } if (prompt.promptId === ‘brands’) { const values = prompt.values.filter((option) => option.selected); let favoriteBrands = []; if (window.localStorage.spo_cf_brand) { favoriteBrands = JSON.parse(window.localStorage.spo_cf_brand).data; } brandTag = values.map(val => val.optionId).join(‘,’); if (favoriteBrands.length > 0) { brandTag += `,${favoriteBrands.map(brand => brand.brandId).join(‘,’)}`; } } if (prompt.promptId === ‘styles’) { const values = prompt.values.filter((option) => option.selected); if (values.length > 0) { styleTag = values.map(val => val.optionId).join(‘,’); } } if (prompt.promptId === ‘occasion’) { const values = prompt.values.filter((option) => option.selected); if (values.length > 0) { occasionTag = values.map(val => val.optionId).join(‘,’); } } if (prompt.promptId === ‘colors’) { for (const option of prompt.values) { if (option.selected) { if (!colorTag) { colorTag = option.optionId; } else { colorTag += `,${option.optionId}` } if (!patternTag) { patternTag = option.optionId; } else { patternTag += `,${option.optionId}` } } } } } if (brandTag.length === 0) { brandTag = null; } let products = ”; let favoriteProducts = []; if (window.localStorage.spo_cf_product) { favoriteProducts = JSON.parse(window.localStorage.spo_cf_product).data; } const max = 2; let count = 0; let recentlyViewedProducts = getCookie(‘recentlyViewed’); if (recentlyViewedProducts == ”) { recentlyViewedProducts = []; } else { recentlyViewedProducts = JSON.parse(recentlyViewedProducts); } for (const product of recentlyViewedProducts) { if (product.id && product.id !== ” && max > count) { products += `${product.id}|`; count++; } } products += favoriteProducts.map(product => product.productId).join(‘|’); url = `https://spo-partner-api.azure-api.net/Discover?subscription-key=662cff71ce7d49088924abf032a0785c&genderTag=${encodeURIComponent(genderTag)}&patternTag=${encodeURIComponent(patternTag)}&productTypeTag=${encodeURIComponent(productTypeTag)}&brandTag=${encodeURIComponent(brandTag)}&styleTag=${encodeURIComponent(styleTag)}&occasionTag=${encodeURIComponent(occasionTag)}&colorTag=${encodeURIComponent(colorTag)}&page=1`; if (products.length > 0) { url += `&products=${encodeURIComponent(products)}`; } fetch(url, { method: ‘GET’, headers: { ‘Content-Type’: ‘application/json’, ‘Accept’: ‘application/json’, ‘Authorization’: `Bearer 1099c1c0a613651c486503c8c1b934` }, }) .then(res => res.json()) .then(data => addToFeed(data)); } }) .catch((error) => { console.log(error); }); } else { $(‘.discovery-quiz-bar’).html(`

Sign in for better recommendations

Sign In`); let products = ”; const max = 2; let count = 0; let recentlyViewedProducts = getCookie(‘recentlyViewed’); if (recentlyViewedProducts == ”) { recentlyViewedProducts = []; } else { recentlyViewedProducts = JSON.parse(recentlyViewedProducts); } for (const product of recentlyViewedProducts) { if (product.id && product.id !== ” && max > count) { products += `${product.id}|`; count++; } } if (products.length > 0) { url += `&products=${encodeURIComponent(products)}`; } fetch(url, { method: ‘GET’, headers: { ‘Content-Type’: ‘application/json’, ‘Accept’: ‘application/json’, ‘Authorization’: `Bearer 1099c1c0a613651c486503c8c1b934` }, }) .then(res => res.json()) .then(data => addToFeed(data)); } } const addGhost = () => { if ($(window).width() < 768) { for (let i = 0; i < 6; i++) { $('.discovery-banner-grid').append(``); } } else { for (let i = 0; i < 7; i++) { $('.discovery-banner-grid').append(``); } } } const addToFeed = (data) => { if ($(window).width() < 768) { for (let i = 0; i < 6; i++) { imgSize = '_512x'; if (data.value[i].Variants.length > 0) { imgUrl = data.value[i].Variants[0].Image.replace(/(.[^.]*)$/,imgSize+”$1″); } $(‘.discovery-banner-grid’).append(“); if (i === 5) { $(‘.ghost’).remove(); $(‘.discovery-feed-img-container’).show(); } } } else { for (let i = 0; i < 7; i++) { imgSize = '_612x'; if (data.value[i].Variants.length > 0) { imgUrl = data.value[i].Variants[0].Image.replace(/(.[^.]*)$/,imgSize+”$1″); } $(‘.discovery-banner-grid’).append(“); if (i === 6) { $(‘.ghost’).remove(); $(‘.discovery-feed-img-container’).show(); } } } setTimeout(function() { window.BackgroundLazyLoader(); }, 200) } const navigateDiscoveryFeed = () => { window.location.href = ‘/pages/discover?cid=HP:PR6:DiscoverFeed’; } addGhost(); getItems();

Source