CINXE.COM
DEMDACO - Not Found
<!DOCTYPE html> <html class="no-js" lang="en"> <head> <link rel="dns-prefetch preconnect" href="https://cdn11.bigcommerce.com/s-kmr73o5t54" crossorigin><link rel="dns-prefetch preconnect" href="https://fonts.googleapis.com/" crossorigin><link rel="dns-prefetch preconnect" href="https://fonts.gstatic.com/" crossorigin> <!--<meta name="description" content="We strive to Lift the Spirit in you, in each other and in our communities. Find Gifts to Lift the Spirit at DEMDACO. "><meta name='platform' content='bigcommerce.stencil' /> --> <meta name="facebook-domain-verification" content="4d2y8in30w56oxpai7yj0zm98i1ack" /> <!-- <title>DEMDACO - Not Found</title> --> <title>Shop All DEMDACO</title> <meta name="keywords" content="Meta Keywords"> <meta name="description" content="We at DEMDACO believe every product creates a conversation. We hope to participate in the meaningful moments of your lives through high-quality items."> <link rel='canonical' href='/shop-by/' /> <meta name='platform' content='bigcommerce.stencil' /> <link href="https://cdn11.bigcommerce.com/s-kmr73o5t54/product_images/Favicon-B2C.png?t=1580498327" rel="shortcut icon"> <meta name="viewport" content="width=device-width, initial-scale=1"/> <script> document.documentElement.className = document.documentElement.className.replace('no-js', 'js'); </script> <script> window.lazySizesConfig = window.lazySizesConfig || {}; window.lazySizesConfig.loadMode = 1; </script> <script async src="https://cdn11.bigcommerce.com/s-kmr73o5t54/stencil/34f13a70-71fa-013d-d0ed-6e3ef077b7cf/e/18cdf900-d520-013d-6672-2a37379de8c6/dist/theme-bundle.head_async.js"></script> <link href="https://fonts.googleapis.com/css?family=Montserrat:400%7CSource+Sans+Pro:400&display=swap" rel="stylesheet"> <link data-stencil-stylesheet href="https://cdn11.bigcommerce.com/s-kmr73o5t54/stencil/34f13a70-71fa-013d-d0ed-6e3ef077b7cf/e/18cdf900-d520-013d-6672-2a37379de8c6/css/theme-8cb7a240-71fa-013d-1a13-56fa05445667.css" rel="stylesheet"> <!-- Start Tracking Code for analytics_facebook --> <script> !function(f,b,e,v,n,t,s){if(f.fbq)return;n=f.fbq=function(){n.callMethod?n.callMethod.apply(n,arguments):n.queue.push(arguments)};if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';n.queue=[];t=b.createElement(e);t.async=!0;t.src=v;s=b.getElementsByTagName(e)[0];s.parentNode.insertBefore(t,s)}(window,document,'script','https://connect.facebook.net/en_US/fbevents.js'); fbq('set', 'autoConfig', 'false', '1966724040245057'); fbq('dataProcessingOptions', ['LDU'], 0, 0); fbq('init', '1966724040245057', {"external_id":"9e65d4c8-cfdb-45ba-88ae-d75449a1aa28"}); fbq('set', 'agent', 'bigcommerce', '1966724040245057'); function trackEvents() { var pathName = window.location.pathname; fbq('track', 'PageView', {}, ""); // Search events start -- only fire if the shopper lands on the /search.php page if (pathName.indexOf('/search.php') === 0 && getUrlParameter('search_query')) { fbq('track', 'Search', { content_type: 'product_group', content_ids: [], search_string: getUrlParameter('search_query') }); } // Search events end // Wishlist events start -- only fire if the shopper attempts to add an item to their wishlist if (pathName.indexOf('/wishlist.php') === 0 && getUrlParameter('added_product_id')) { fbq('track', 'AddToWishlist', { content_type: 'product_group', content_ids: [] }); } // Wishlist events end // Lead events start -- only fire if the shopper subscribes to newsletter if (pathName.indexOf('/subscribe.php') === 0 && getUrlParameter('result') === 'success') { fbq('track', 'Lead', {}); } // Lead events end // Registration events start -- only fire if the shopper registers an account if (pathName.indexOf('/login.php') === 0 && getUrlParameter('action') === 'account_created') { fbq('track', 'CompleteRegistration', {}, ""); } // Registration events end function getUrlParameter(name) { var cleanName = name.replace(/[\[]/, '\[').replace(/[\]]/, '\]'); var regex = new RegExp('[\?&]' + cleanName + '=([^&#]*)'); var results = regex.exec(window.location.search); return results === null ? '' : decodeURIComponent(results[1].replace(/\+/g, ' ')); } } if (window.addEventListener) { window.addEventListener("load", trackEvents, false) } </script> <noscript><img height="1" width="1" style="display:none" alt="null" src="https://www.facebook.com/tr?id=1966724040245057&ev=PageView&noscript=1&a=plbigcommerce1.2&eid="/></noscript> <!-- End Tracking Code for analytics_facebook --> <!-- Start Tracking Code for analytics_googleanalytics --> <script type="text/javascript"> var product_list = []; var orderID=""; var itemArray= []; window.dataLayer = window.dataLayer || []; function trackGTMEcommerce() { this._addTrans = addTrans; this._addItem = addItems; this._trackTrans = trackTrans; } var transaction = {}; transaction.transactionProducts = []; function addTrans(orderID, store, total, tax, shipping, city, state, country) { transaction.transactionId = orderID; transaction.transactionAffiliation = store; transaction.transactionTotal = total; transaction.transactionTax = tax; transaction.transactionShipping = shipping; } function addItems(orderID, sku, product, variation, price, quantity) { orderID=orderID; product_list.push( { id: sku,price: price, quantity: quantity}); itemArray.push([price, quantity,orderID]); transaction.transactionProducts.push({ 'id': sku, 'sku': sku, 'name': product, 'category': variation, 'price': price, 'quantity': quantity }); // console.log('a') } function trackTrans() { transaction.event = 'bcTransactionComplete'; // console.log(transaction); dataLayer.push(transaction); } var pageTracker = new trackGTMEcommerce(); </script> <!-- end Google Tag Manager Data Layer --> <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); })(window,document,'script','dataLayer','GTM-PKVMK2B');</script> <!-- End Google Tag Manager --> <script type="text/javascript"> var dataLayer = dataLayer || []; function dataLayerManager() { if(document.getElementById("LayoutColumn2") !== null) { var res = document.getElementById("LayoutColumn2").innerHTML; res = res.substring(res.indexOf("sharingData")); res = res.replace("sharingData = ", ""); res = res.substring(0, res.indexOf("lang.ChooseAnotherProduct")); res = res.trim(); res = res.substring(0, res.length - 1); var obj = JSON.parse(res); var prdArray=[]; for (var p in obj) { prdArray.push(p); } console.log(product_list); console.log(prdArray); dataLayer.push({ 'PageType': 'TransactionPage', 'email': getCookie("CustomerEmail"), 'ProductTransactionProducts': product_list, 'TransactionID': itemArray[0][2], }); } } function getCookie(c_name) { if (document.cookie.length > 0) { c_start = document.cookie.indexOf(c_name + "="); if (c_start != -1) { c_start = c_start + c_name.length + 1; c_end = document.cookie.indexOf(";", c_start); if (c_end == -1) { c_end = document.cookie.length; } return unescape(document.cookie.substring(c_start, c_end)); } } return ""; } window.onload = dataLayerManager; </script> <!-- End Tracking Code for analytics_googleanalytics --> <!-- Start Tracking Code for analytics_googleanalytics4 --> <script data-cfasync="false" src="https://cdn11.bigcommerce.com/shared/js/google_analytics4_bodl_subscribers-358423becf5d870b8b603a81de597c10f6bc7699.js" integrity="sha256-gtOfJ3Avc1pEE/hx6SKj/96cca7JvfqllWA9FTQJyfI=" crossorigin="anonymous"></script> <script data-cfasync="false"> (function () { window.dataLayer = window.dataLayer || []; function gtag(){ dataLayer.push(arguments); } function initGA4(event) { function setupGtag() { function configureGtag() { gtag('js', new Date()); gtag('set', 'developer_id.dMjk3Nj', true); gtag('config', 'G-VFVH767R2F'); } var script = document.createElement('script'); script.src = 'https://www.googletagmanager.com/gtag/js?id=G-VFVH767R2F'; script.async = true; script.onload = configureGtag; document.head.appendChild(script); } setupGtag(); if (typeof subscribeOnBodlEvents === 'function') { subscribeOnBodlEvents('G-VFVH767R2F', false); } window.removeEventListener(event.type, initGA4); } var eventName = document.readyState === 'complete' ? 'consentScriptsLoaded' : 'DOMContentLoaded'; window.addEventListener(eventName, initGA4, false); })() </script> <!-- End Tracking Code for analytics_googleanalytics4 --> <!-- Start Tracking Code for analytics_siteverification --> <meta name="google-site-verification" content="mRTQ-uNo4GGH8GNpc_8dDB8k0yvbBvkDb7YEeMNTtXc" /> <!-- End Tracking Code for analytics_siteverification --> <script type="text/javascript" src="https://checkout-sdk.bigcommerce.com/v1/loader.js" defer></script> <script type="text/javascript"> var BCData = {}; </script> <script type="text/javascript"> var ScarabQueue = ScarabQueue || []; (function(id) { if (document.getElementById(id)) return; var js = document.createElement('script'); js.id = id; js.src = '//cdn.scarabresearch.com/js/1E9A90E26307793E/scarab-v2.js'; var fs = document.getElementsByTagName('script')[0]; fs.parentNode.insertBefore(js, fs); })('scarab-js-api'); window.customerid = ''; window.customeremail = ''; if (window.customerid != ""){ ScarabQueue.push(['setEmail', window.customeremail]); } console.log("Emarsys Script Found in the Header"); console.log(ScarabQueue); console.log(document.createElement('script')); console.log(window.customerid); console.log(window.customeremail); console.log("END OF Emarsys Script Found in the Header"); </script> <script> // <style>.xnpe_async_hide{opacity:0 !important}</style> !function(e,n,t,i,o,r){function a(e){if("number"!=typeof e)return e;var n=new Date;return new Date(n.getTime()+1e3*e)}var c=4e3,s="xnpe_async_hide";function p(e){return e.reduce((function(e,n){return e[n]=function(){e._.push([n.toString(),arguments])},e}),{_:[]})}function m(e,n,t){var i=t.createElement(n);i.src=e;var o=t.getElementsByTagName(n)[0];return o.parentNode.insertBefore(i,o),i}function u(e){return"[object Date]"===Object.prototype.toString.call(e)}r.target=r.target||"https://api.exponea.com",r.file_path=r.file_path||r.target+"/js/exponea.min.js",o[n]=p(["anonymize","initialize","identify","getSegments","update","track","trackLink","trackEnhancedEcommerce","getHtml","showHtml","showBanner","showWebLayer","ping","getAbTest","loadDependency","getRecommendation","reloadWebLayers","_preInitialize"]),o[n].notifications=p(["isAvailable","isSubscribed","subscribe","unsubscribe"]),o[n]["snippetVersion"]="v2.5.0",function(e,n,t){e[n]["_"+t]={},e[n]["_"+t].nowFn=Date.now,e[n]["_"+t].snippetStartTime=e[n]["_"+t].nowFn()}(o,n,"performance"),function(e,n,t,i,o,r){e[o]={sdk:e[i],sdkObjectName:i,skipExperiments:!!t.new_experiments,sign:t.token+"/"+(r.exec(n.cookie)||["","new"])[1],path:t.target}}(o,e,r,n,i,RegExp("__exponea_etc__"+"=([\\w-]+)")),function(e,n,t){m(e.file_path,n,t)}(r,t,e),function(e,n,t,i,o,r,p){if(e.new_experiments){!0===e.new_experiments&&(e.new_experiments={});var l,f=e.new_experiments.hide_class||s,_=e.new_experiments.timeout||c,d=encodeURIComponent(r.location.href.split("#")[0]);e.cookies&&e.cookies.expires&&("number"==typeof e.cookies.expires||u(e.cookies.expires)?l=a(e.cookies.expires):e.cookies.expires.tracking&&("number"==typeof e.cookies.expires.tracking||u(e.cookies.expires.tracking))&&(l=a(e.cookies.expires.tracking))),l&&l<new Date&&(l=void 0);var x=e.target+"/webxp/"+n+"/"+r[t].sign+"/modifications.min.js?http-referer="+d+"&timeout="+_+"ms"+(l?"&cookie-expires="+Math.floor(l.getTime()/1e3):"");"sync"===e.new_experiments.mode&&r.localStorage.getItem("__exponea__sync_modifications__")?function(e,n,t,i,o){t[o][n]="<"+n+' src="'+e+'"></'+n+">",i.writeln(t[o][n]),i.writeln("<"+n+">!"+o+".init && document.writeln("+o+"."+n+'.replace("/'+n+'/", "/'+n+'-async/").replace("><", " async><"))</'+n+">")}(x,n,r,p,t):function(e,n,t,i,o,r,a,c){r.documentElement.classList.add(e);var s=m(t,i,r);function p(){o[c].init||m(t.replace("/"+i+"/","/"+i+"-async/"),i,r)}function u(){r.documentElement.classList.remove(e)}s.onload=p,s.onerror=p,o.setTimeout(u,n),o[a]._revealPage=u}(f,_,x,n,r,p,o,t)}}(r,t,i,0,n,o,e),function(e,n,t){var i;(null===(i=t.experimental)||void 0===i?void 0:i.non_personalized_weblayers)&&e[n]._preInitialize(t),e[n].start=function(i){i&&Object.keys(i).forEach((function(e){return t[e]=i[e]})),e[n].initialize(t)}}(o,n,r)}(document,"exponea","script","webxpClient",window,{ target: "https://api.us1.exponea.com", token: "9d2ce712-f9ad-11ed-9f67-ea39a92bce4d", new_experiments: { mode: "sync" }, // replace with current customer ID or leave commented out for an anonymous customer customer: "", track: { visits: true, }, }); exponea.start(); </script><script src="https://cdn.noibu.com/collect-core.js"></script><script> window.addEventListener('load', () => { const fetchCartData = async () => { const options = { method: "GET", headers: { Accept: "application/json", "Content-Type": "application/json", }, }; try { const response = await fetch( `${window.location.origin}/api/storefront/carts`, options ); if (!response.ok) { console.error( `HTTP Error: ${response.status} - ${response.statusText}` ); return undefined; } const data = await response.json(); return data[0]; // Return the first cart if it exists, otherwise undefined } catch (error) { console.error("Fetch error:", error); return undefined; } }; const fetchCheckout = async (checkoutId) => { const options = { method: "GET", headers: { Accept: "application/json", "Content-Type": "application/json", }, }; try { const url = `${window.location.origin}/api/storefront/checkouts/${checkoutId}`; const response = await fetch(url, options); if (!response.ok) { console.error( `HTTP Error: ${response.status} - ${response.statusText}` ); return undefined; } const data = await response.json(); return data; } catch (error) { console.error("Fetch error:", error); return undefined; } }; const addCustomAttribute = (key, value) => { if (window.NOIBUJS) { window.NOIBUJS.addCustomAttribute(key, value); } else { window.addEventListener('noibuSDKReady', () => { window.NOIBUJS.addCustomAttribute(key, value); }); } }; if (typeof window.bodlEvents?.cart?.on === "function") { window.bodlEvents.cart.viewed(async (payload) => { const cartData = await fetchCartData(); if (cartData) { sessionStorage.setItem("cartId", cartData?.id); addCustomAttribute("cartId", cartData?.id); } }); } if (typeof window.bodlEvents.checkout.checkoutBegin === "function") { window.bodlEvents.checkout.checkoutBegin(async (payload) => { const cartId = sessionStorage.getItem("cartId"); if (cartId) { addCustomAttribute("checkoutId", cartId); } }); } if (typeof window.bodlEvents.checkout.orderPurchased === "function") { window.bodlEvents.checkout.orderPurchased((payload) => { addCustomAttribute("orderId", payload?.order_id?.toString()); }); } if (window?.bodl?.shopper?.customer_id) { addCustomAttribute("customerId", window.bodl.shopper.customer_id); } if (window?.bodl?.session?.id) { addCustomAttribute("sessionId", window.bodl.session.id); } }, false) </script> <script> async function handleHelpCode() { if (window.NOIBUJS?.requestHelpCode) { const helpCodeField = document.getElementById("help-code-field"); if (helpCodeField != null) { const helpCode = await window.NOIBUJS.requestHelpCode(false); helpCodeField.innerText = helpCode; } } } if (window?.NOIBUJS) { handleHelpCode(); } else { window.addEventListener('noibuSDKReady', handleHelpCode); } </script> <script> async function handleButtonHelpCode() { const button = document.getElementById("request-help-code"); const label = document.getElementById("help-code-result"); if (button != null && label != null) { button.addEventListener("click", async () => { if (window.NOIBUJS?.requestHelpCode) { const helpCode = await window.NOIBUJS.requestHelpCode(false); label.innerText = helpCode; } }); } } if (window?.NOIBUJS) { handleButtonHelpCode(); } else { window.addEventListener("noibuSDKReady", handleButtonHelpCode); } </script> <script data-cfasync="false" src="https://microapps.bigcommerce.com/bodl-events/index.js" integrity="sha256-7v3TbkaDPU/SvbmSe05PkgOkuNX1nZ9R7eKeO33bZKs=" nonce="" crossorigin="anonymous"></script> <script data-cfasync="false" nonce=""> (function() { function decodeBase64(base64) { const text = atob(base64); const length = text.length; const bytes = new Uint8Array(length); for (let i = 0; i < length; i++) { bytes[i] = text.charCodeAt(i); } const decoder = new TextDecoder(); return decoder.decode(bytes); } window.bodl = JSON.parse(decodeBase64("eyJzZXNzaW9uIjp7ImlkIjoiZjlhODNhMTgtMTRmNC00OWU0LWFjMmEtMzhlYjI4ZGEyZjA5IiwiZmlyc3RfdG91Y2hfdGltZXN0YW1wIjoiMjAyNS0wMi0yNlQxNjoxNTo0MCIsImZpcnN0X3RvdWNoX3JlZmVycmFsX3VybCI6IiIsImZpcnN0X3RvdWNoX3JlcXVlc3RfdXJsIjoiaHR0cHM6Ly93d3cuZGVtZGFjby5jb20vc2hvcC1ieS9kZXB0L2hvbWUvc3ViY2xhc3MvYmxhbmtldHMifSwic2hvcHBlciI6eyJ2aXNpdG9yX2lkIjoiIiwiY3VzdG9tZXJfaWQiOm51bGwsImVtYWlsIjpudWxsLCJmaXJzdF9uYW1lIjpudWxsLCJsYXN0X25hbWUiOm51bGx9LCJkYXRhX2NvbnNlbnQiOnsiZnVuY3Rpb25hbCI6dHJ1ZSwiYW5hbHl0aWNzIjp0cnVlLCJhZHZlcnRpc2luZyI6dHJ1ZX0sImV2ZW50cyI6W119")); })() </script> <script nonce=""> (function () { var xmlHttp = new XMLHttpRequest(); xmlHttp.open('POST', 'https://bes.gcp.data.bigcommerce.com/nobot'); xmlHttp.setRequestHeader('Content-Type', 'application/json'); xmlHttp.send('{"store_id":"999719666","timezone_offset":"-5.0","timestamp":"2025-02-26T16:15:40.67738100Z","visit_id":"75500fcd-1b53-4fd6-a013-430769b76f7a","channel_id":1}'); })(); </script> <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script> <script src="//assets.findify.io/www.demdaco.com.min.js" async defer></script> <!--<script src="//findify-assets-2bveeb6u8ag.netdna-ssl.com/search/prod/www.demdaco.com.min.js" async defer></script>--> <!--<script src="//findify-assets-2bveeb6u8ag.netdna-ssl.com/search/prod/b2cdemdaco-dev.mybigcommerce.com.min.js" async defer></script>--> <!--<script src="https://www.googleoptimize.com/optimize.js?id=OPT-M2CXW2C"></script>--> <!-- Google Tag Manager (noscript) --> <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-PKVMK2B" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript> <!-- End Google Tag Manager (noscript) --> <script> !function(){var analytics=window.analytics=window.analytics||[];if(!analytics.initialize)if(analytics.invoked)window.console&&console.error&&console.error("Segment snippet included twice.");else{analytics.invoked=!0;analytics.methods=["trackSubmit","trackClick","trackLink","trackForm","pageview","identify","reset","group","track","ready","alias","debug","page","once","off","on","addSourceMiddleware","addIntegrationMiddleware","setAnonymousId","addDestinationMiddleware"];analytics.factory=function(e){return function(){var t=Array.prototype.slice.call(arguments);t.unshift(e);analytics.push(t);return analytics}};for(var e=0;e<analytics.methods.length;e++){var key=analytics.methods[e];analytics[key]=analytics.factory(key)}analytics.load=function(key,e){var t=document.createElement("script");t.type="text/javascript";t.async=!0;t.src="https://cdn.segment.com/analytics.js/v1/" + key + "/analytics.min.js";var n=document.getElementsByTagName("script")[0];n.parentNode.insertBefore(t,n);analytics._loadOptions=e};analytics._writeKey="zEvwxXJWb3m1YY4SUrCC17Xjz0cQV3OH";;analytics.SNIPPET_VERSION="4.15.3"; analytics.load("zEvwxXJWb3m1YY4SUrCC17Xjz0cQV3OH"); }}(); </script> </head> <body class="page-404 CustomerNotSignIn" data-template="pages/errors/404"> <svg data-src="https://cdn11.bigcommerce.com/s-kmr73o5t54/stencil/34f13a70-71fa-013d-d0ed-6e3ef077b7cf/e/18cdf900-d520-013d-6672-2a37379de8c6/img/icon-sprite.svg" class="icons-svg-sprite"></svg> <a href="#mainContent" class="is-srOnly">Jump to main content</a> <a href="#footerContent" class="is-srOnly">Jump to Footer</a> <style> /* if twolines */ @media (max-width: 1000px){ .overlayBlack { /* top: 63px; */ } } </style> <!--<div style="background-color: #425563; text-align: center; color: white; padding: 5px 0px;"> Choose a FREE ARK bracelet with $85+ purchase </div>--> <div class="topSkinny banners bsh"> <div style="max-width: 1200px;display: flex;margin: 0px auto;justify-items: center;align-items: center;align-content: center;padding: 5px;"> <p style=" margin: 0px; width: 100%; text-align: center; color: white; "><b>Free Shipping</b> on orders $75+</p> </div> </div> <div id="header-placeholder"></div> <header class="header" role="banner"> <div class="inner-header"> <!--this is the start of the navCode JLM --> <style> @media (max-width: 1000px) { .header, .header.sticky { height: 110px !important; } } @media (max-width: 1250px) { .header, .header.sticky { height: 117px !important; } } @media (max-width: 1300px) { .header, .header.sticky { height: 75px; } } </style> <div class="overlayBlack"></div> <nav class="navPages"> <div class="LogoSearchAccount" > <a href="https://www.demdaco.com/" class="header-logo-image" > <img src="https://store-kmr73o5t54.mybigcommerce.com/content/DemdacoLogo-01.svg" alt="DEMDACO" title="DEMDACO"> <!--<img src="https://store-kmr73o5t54.mybigcommerce.com/content/DD-logo-holiday.jpg" alt="DEMDACO" title="DEMDACO">--> </a> <div class="navPages-quickSearch"> <form class="form" action="/search.php"> <fieldset class="form-fieldset"> <legend class="is-srOnly">Quick Search:</legend> <label class="is-srOnly" for="search_query">Search</label> <div class="form-field"> <!-- id="search_query" --> <input class="form-input" data-search-quick name="search_query" data-error-message="Search field cannot be empty." placeholder="Search for unique products with purpose." autocomplete="off"> <input class="btn" data-tooltip="Search for unique products with purpose" type="submit" value="submit"> </div> </fieldset> </form> <section class="quickSearchResults" data-bind="html: results" style="display: none;"></section> </div> <div class="navIconsList"> <div class="navIcon objectFill"> <a class="navUser-action" aria-label="Account" href="/account.php"> <img src="https://store-kmr73o5t54.mybigcommerce.com/content/icons/Navicons-03.svg" alt="My Account"></a> </div> <div class="navIcon objectFill"> <a class="navUser-action" aria-label="WishList" href="/wishlist.php"> <img src="https://store-kmr73o5t54.mybigcommerce.com/content/icons/Navicons-02.svg" alt="See Wishlist"></a> </div> <div class="navIcon objectFill"> <a data-tooltip="Your current cart" aria-label="Cart" class="navUser-action" data-cart-preview="" data-dropdown="cart-preview-dropdown" data-options="align:right" href="/cart.php"> <img src="https://store-kmr73o5t54.mybigcommerce.com/content/icons/Navicons-01.svg" alt="cart icon"> <span class="navUser-item-cartLabel">Cart</span> </a> <div class="dropdown-menu" id="cart-preview-dropdown" data-dropdown-content="" aria-hidden="true"></div> </div> <div class="navIcon objectFill"> <img src="https://store-kmr73o5t54.mybigcommerce.com/content/icons/newIcons/Navicons-05.svg" alt="close icon" class="openMenu"> </div> </div> </div> <!-- <div class="mobileMenu-toggleParent" style="height: 18px; padding: 0; width: 20px; top: 49%; margin-top: -9px; left: 20px; position: absolute;"> <div class="mobileMenu-toggleParentClick" style="height: 18px; padding: 0px; width: 20px; margin: 0px; position: relative; z-index: 999"> </div> <button href="#" class="mobileMenu-toggle" data-mobile-menu-toggle="menu"> <span class="mobileMenu-toggleIcon">Toggle menu</span> </button> </div> --> <!-- this element was added to be a Clickable element so we can use the menu in safari. Currently Safari does not support AddEventlisteners on elements with position absolute JLM --> <!-- The Parent Element is to make sure the Toggle is poistioned in the same box as the trigger element JLM --> <div id="menu-container" class="navMegaBar full-width" > <div class="MobileDetails"> <p>Welcome!</p> <div class="navIconsList"> <div class="navIcon objectFill"> <a class="navUser-action" aria-label="Account" href="/account.php"> <!-- Dropdown Menu --> <img src="https://store-kmr73o5t54.mybigcommerce.com/content/icons/Navicons-03.svg" alt="My Account"></a> </div> <div class="navIcon objectFill"> <a class="navUser-action" aria-label="WishList" href="/wishlist.php"> <img src="https://store-kmr73o5t54.mybigcommerce.com/content/icons/Navicons-02.svg" alt="See Wishlist"></a> </div> <div class="navIcon objectFill"> <a data-tooltip="Your current cart" aria-label="Cart" class="navUser-action" data-cart-preview="" data-dropdown="cart-preview-dropdown" data-options="align:right" href="/cart.php"> <img src="https://store-kmr73o5t54.mybigcommerce.com/content/icons/Navicons-01.svg" alt="cart icon"> <span class="navUser-item-cartLabel">Cart</span> </a> <div class="dropdown-menu" id="cart-preview-dropdown" data-dropdown-content="" aria-hidden="true"></div> </div> <div class="navIcon objectFill"> <img src="https://store-kmr73o5t54.mybigcommerce.com/content/icons/newIcons/Navicons-04.svg" alt="close icon" class="closeMenu"> </div> </div> <!-- <p style="width: 100%; display: block;"><a href="/login.php?action=logout" >sign out</a></p> --> </div> </div> <script> document.addEventListener("DOMContentLoaded", function() { fetch("https://store-kmr73o5t54.mybigcommerce.com/content/sitemap/MegaNav.json") .then(response => response.json()) .then(data => { const menuContainer = document.querySelector(".navMegaBar"); const footerContainer = document.createElement('div'); footerContainer.classList.add('MegaNavFooter'); if (!menuContainer || !data.MegaNavAll || !Array.isArray(data.MegaNavAll) || !data.MegaNavAll[0]) { console.error("Data or DOM format is not as expected."); return; } const megaNavData = data.MegaNavAll[0]; for (const [categoryName, subCategoriesArr] of Object.entries(megaNavData)) { if (categoryName !== 'Footer') { const rootItem = document.createElement("button"); rootItem.classList.add("navPages-action", "navPages-action-depth-max", "contains-subMenu", "is-root"); rootItem.textContent = categoryName; if (subCategoriesArr[0].parent_url) { rootItem.setAttribute("data-parent-url", subCategoriesArr[0].parent_url); } const subMenu = document.createElement("div"); subMenu.classList.add("navPage-issubMenu"); // Add "Back" div at the beginning of this submenu const backButtonDiv = document.createElement("div"); backButtonDiv.textContent = "Back"; backButtonDiv.classList.add("mobileBack"); // Adding the class subMenu.appendChild(backButtonDiv); // Adding the click event backButtonDiv.onclick = function(e) { e.preventDefault(); console.log('this was triggered'); let parentDiv = this.parentElement; // Get the parent element if (parentDiv) { document.querySelectorAll('.is-root').forEach(function(root) { root.classList.remove('is-open'); }); parentDiv.classList.remove('is-open'); // Remove the class 'is-open' } }; const subMenuList = document.createElement("ul"); subMenuList.classList.add("navPage-issubMenu-list"); subCategoriesArr.forEach(subCategories => { for (const [subCategoryName, subSubCategories] of Object.entries(subCategories)) { if (Array.isArray(subSubCategories)) { const subMenuItem = document.createElement("li"); subMenuItem.classList.add("navPage-issubMenu-item-child"); const subMenuLink = document.createElement("a"); subMenuLink.textContent = subCategoryName; subMenuLink.classList.add("navPage-subMenu-action", "navPages-action", "navPages-action-depth-max", "has-subMenu"); // Add click event to the subMenuLink subMenuLink.onclick = function(e) { e.preventDefault(); const ulElement = this.nextElementSibling; if (ulElement && ulElement.tagName === 'UL') { ulElement.classList.toggle('show-menu'); } }; const innerList = document.createElement("ul"); const backButtonDivSub = document.createElement("div"); backButtonDivSub.textContent = "Back"; backButtonDivSub.classList.add("mobileBack"); // Adding the class innerList.appendChild(backButtonDivSub); // Adding the click event backButtonDivSub.onclick = function(e) { e.preventDefault(); console.log('this was triggered'); let parentDiv = this.parentElement; // Get the parent element if (parentDiv) { parentDiv.classList.remove('show-menu'); // Remove the class 'is-open' } }; function capitalizeWords(str) { return str.split(' ') .map(word => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase()) .join(' '); } subSubCategories.forEach(item => { const innerListItem = document.createElement("li"); const innerLink = document.createElement("a"); innerLink.href = item.cat_url; innerLink.textContent = capitalizeWords(item.cat_title); innerListItem.appendChild(innerLink); innerList.appendChild(innerListItem); }); subMenuItem.appendChild(subMenuLink); subMenuItem.appendChild(innerList); subMenuList.appendChild(subMenuItem); } } }); subMenu.appendChild(subMenuList); menuContainer.appendChild(rootItem); menuContainer.appendChild(subMenu); } else { subCategoriesArr[0].Footer.forEach(item => { const footerLink = document.createElement('a'); footerLink.classList.add('featured', 'navfooter'); footerLink.href = item.cat_url; footerLink.textContent = item.cat_title; footerContainer.appendChild(footerLink); }); menuContainer.appendChild(footerContainer); } } const roots = document.querySelectorAll(".navPages-action.is-root"); roots.forEach(function(root) { root.addEventListener("click", function(event) { const parentUrl = root.getAttribute("data-parent-url"); if (parentUrl) { window.location.href = parentUrl; return; } const nextSibling = root.nextElementSibling; const megaNavFooter = document.querySelector('.MegaNavFooter'); if (nextSibling && nextSibling.classList.contains("navPage-issubMenu")) { nextSibling.classList.toggle("is-open"); root.classList.toggle("is-open"); if (nextSibling.classList.contains("is-open")) { megaNavFooter.style.display = 'flex'; } else { megaNavFooter.style.display = 'none'; } } roots.forEach(function(otherRoot) { if (otherRoot !== root) { const otherSibling = otherRoot.nextElementSibling; if (otherSibling && otherSibling.classList.contains("navPage-issubMenu")) { otherSibling.classList.remove("is-open"); otherRoot.classList.remove("is-open"); } } }); }); }); document.addEventListener("click", function(event) { const isOutsideMegaBar = !event.target.closest('.navMegaBar'); const isOutsideSubMenu = !event.target.closest('.navPage-issubMenu'); if (isOutsideMegaBar && isOutsideSubMenu) { const megaNavFooter = document.querySelector('.MegaNavFooter'); megaNavFooter.style.display = 'none'; // Loop through all the roots and close them roots.forEach(function(root) { const sibling = root.nextElementSibling; if (sibling && sibling.classList.contains("navPage-issubMenu")) { sibling.classList.remove("is-open"); root.classList.remove("is-open"); } }); } }); const links = document.querySelectorAll('.navPages ul li a'); links.forEach(function(link) { if (link.textContent.trim() === 'Shop All') { const currentSize = window.getComputedStyle(link, null).getPropertyValue('font-size'); const currentSizeInPx = parseFloat(currentSize); // Removes the "px" and converts to number const newSizeInPx = currentSizeInPx + 2; link.style.fontSize = `${newSizeInPx}px`; link.style.fontWeight = 'bold'; const parent = link.parentNode; parent.style.marginTop = '10px'; } }); }) .catch(err => { console.error("An error occurred:", err); }); }); var menu = document.querySelector('.navMegaBar'); var overlay = document.querySelector('.overlayBlack'); function toggleMenu(open, isScrollEvent = false) { var modalMobileFilters = document.querySelector('.modalMobileFilters'); console.log("toggleMenu called", open); // Debug line if (window.innerWidth <= 1000) { // Assuming 800px as the breakpoint for mobile view console.log("Inside mobile view"); // Debug line if (open) { console.log("Opening menu"); // Debug line menu.style.display = 'block'; setTimeout(() => { menu.classList.add('active'); // Adds class to trigger CSS transition overlay.classList.add('active'); }, 10); // Short timeout to ensure that `display: block` gets applied first if (modalMobileFilters && !isScrollEvent) { modalMobileFilters.classList.add('Mobilehide'); // Add the 'Mobilehide' class when the menu is closed console.log('Modal closed MegaBar'); } } else { console.log("Closing menu"); // Debug line menu.classList.remove('active'); // Removes class to trigger CSS transition overlay.classList.remove('active'); setTimeout(() => { menu.style.display = 'none'; // Hide after animation is done }, 300); // 300ms to match CSS transition duration if (modalMobileFilters && !isScrollEvent) { modalMobileFilters.classList.add('Mobilehide'); // Add the 'Mobilehide' class when the menu is closed console.log('Modal closed Scroll'); } } } } let lastScrollTop = 0; window.addEventListener("scroll", function() { let scrollTop = window.pageYOffset || document.documentElement.scrollTop; if (scrollTop > lastScrollTop) { // toggleMenu(false, true); // Close the menu and indicate that it's a scroll event } else { } lastScrollTop = scrollTop <= 0 ? 0 : scrollTop; }, false); document.querySelector('.navIconsList .navIcon .openMenu').addEventListener('click', () => { document.documentElement.style.overflow = 'hidden'; toggleMenu(true) }); document.querySelector('.navIconsList .navIcon .closeMenu').addEventListener('click', () => { document.documentElement.style.overflow = 'auto'; toggleMenu(false) }); let navPagesActionsubMenu = document.querySelectorAll('.mobileBack'); function toggleVisibility(e) { e.preventDefault(); let closestLi = this.closest('li'); let closestUl = closestLi.querySelector('ul'); console.log(closestUl); console.log(closestLi); console.log(this); console.log('this was triggered'); // closestUl.classList.toggle('show-menu'); } function manageEventListeners() { if (window.innerWidth <= 1000) { navPagesActionsubMenu.forEach(function(navPagesActionsubMenu) { navPagesActionsubMenu.addEventListener('click', toggleVisibility); }); } else { } } // Initial check manageEventListeners(); window.addEventListener('resize', manageEventListeners); // Function to check window width and update display style function checkWindowSize() { const menuContainer = document.getElementById("menu-container"); if (window.innerWidth > 1000) { menuContainer.style.display = "flex"; } else { menuContainer.style.display = "none"; } } // Initial check checkWindowSize(); // Listen for window resize events window.addEventListener("resize", checkWindowSize); </script> </nav> <!--this is the end of the navCode JLM --> </div> </header> <div data-content-region="header_bottom"></div> <main role="main" id="mainContent"> <!-- childtheme/_new-components/see-more/ui-example --> <div class="body" data-currency-code="USD"> <div class="container maxWidthContent"> <script> let products = ""; var plpProducts = ""; let orderList = ["top_level","format","artist_name","occasion","holiday","recipient","sentiment","collection_name","seasonal","color","indoor_outdoor_use","age_group","sku","room","gender","home_decor_style","size_grouping","animal_variety","washing_instructions","apparel_material","closure_type","frame_holds_photo","garment_torso_length","orientation","garment_sleeve_length","item_placement","garment_neckline","frame_material","pant_length","frame_display_type","battery_information","game_type","fashion_style","textile_wash_method","textile_dry_method","bag_structure","bag_shell_material","exterior_features","interior_features","shape","cycle","new","digital_format","brand", "buy-with-prime","as_seen_in_catalog","product_category","scent"]; let defaultExluisionList = ["PDP-VIDEO-IMAGECAROUSEL", "size", 'PERSONALIZATION-URL', 'INTRODUCTION-DATE', 'TARGET-AUDIENCE-AGE', 'DIGITAL-FORMAT', 'COPYRIGHT-LONG', 'artist-bio-link', 'artist-bio', 'artist-bio 1', 'artist-bio 2', 'artist-bio 3', 'artist-bio 4', 'artist-bio 5', 'google-format', 'google-id', 'manufacturer', 'Introduction_Date', 'Copyright_Long', 'Artist_Bio', 'Google_ID', 'Artist Bio Link', 'Artist Image', 'Country Of Origin', 'Allow Purchase', 'Artist Bio', 'Artist Bio 1', 'Artist Bio 2', 'Artist Bio 3', 'Artist Bio 4', 'Artist Bio 5', 'WT Description', 'Google Format', 'PDP_Video_ImageCarousel', 'TARGET_AUDIENCE_AGE', ]; let dynamicExluisionList = [...defaultExluisionList]; let activeFilters = []; let rawData = ""; let pageInfo = ""; let collectionInfo = ""; let afterArgument = "" let selectedFacets = []; let cursors = []; let isNextPage; let cursor; let isFirstRun = true; let currentPage = 1; // Define a variable to keep track of the current page let att = '' let afterCursor = ""; // Initialize the cursor outside of function let customFieldsCollectArry = []; // Initialize this if it's not already let maxCalls = 5; // Define the maximum number of calls let totalPages; let defaultFacets = '' let fieldCounts = {}; let rawData2 = "" var DefaultFilters = "" var productArray = "" let ArraySelections = [] var FiltersSet = "" var CustomCallData = "" let mergedFilters = []; var TestFilters = document.querySelector(".filtersTest") var TestProducts = document.querySelector(".ProductsTest") let CustomFieldArry = []; let facetsAdditions = '' const keysToCollect = ['materials', 'seasonality', 'age', 'fashion-size', 'gender', 'closure-type', 'frame-size', 'garment-torso-length', 'orientation', 'garment-sleeve-length', 'garment-neckline', 'frame-material', 'frame-backer-style', 'battery-information', 'game-type', 'textile-wash-method', 'textile-dry-method', 'bag-structure', 'bag-exterior-features', 'shape', 'fragrance', 'new', 'brand', "buy-with-prime"]; function GraphQLCall(Query) { return fetch("/graphql", { method: 'POST', credentials: 'include', mode: 'cors', headers: { 'Content-Type': 'application/json', 'Authorization': 'Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJFUzI1NiJ9.eyJjaWQiOlsxXSwiY29ycyI6WyJodHRwczovL3d3dy5kZW1kYWNvLmNvbSJdLCJlYXQiOjE3NDA3NTAwNjMsImlhdCI6MTc0MDU3NzI2MywiaXNzIjoiQkMiLCJzaWQiOjk5OTcxOTY2Niwic3ViIjoiQkMiLCJzdWJfdHlwZSI6MCwidG9rZW5fdHlwZSI6MX0.u79r7CpDX4T61cYP3ugBA_Ba7dvOCquqmlMvq9R9pgZR_ayX88blVMO2YpN4C1BHw0KAf8XX6XLqFB2890PDYA' }, body: JSON.stringify({ query: Query }), }).then(res => res.json()) } function consolidateFilters(activeFilters) { const consolidated = {}; for (const filter of activeFilters) { const { key, value } = filter; if (!consolidated[key]) { consolidated[key] = []; } consolidated[key] = [...new Set([...consolidated[key], ...value])]; } return Object.entries(consolidated).map(([key, value]) => ({ key: key, value: value })); } function getActiveFacetsFromURL() { let activeFilters = []; // Process pathname const segments = window.location.pathname.split('/'); for (let i = 2; i < segments.length; i += 2) { const key = segments[i]; const value = segments[i + 1]; if (!key || !value) continue; let filter = activeFilters.find(f => f.key === key); if (!filter) { filter = { key: key, value: [] }; activeFilters.push(filter); } filter.value.push(value); } // Process query parameters const params = new URLSearchParams(window.location.search); for (const [key, value] of params.entries()) { // Exclude parameters that are not prefixed with 'Additional' if (!key.startsWith('Additional')) continue; const realKey = key.replace('Additional', ''); let filter = activeFilters.find(f => f.key === realKey); if (!filter) { filter = { key: realKey, value: [] }; activeFilters.push(filter); } const additionalvalue = value.includes(":") ? value.split(":") : [value]; filter.value = [...new Set([...filter.value, ...additionalvalue])]; } // Assuming consolidateFilters function is available activeFilters = consolidateFilters(activeFilters); //console.log("Consolidated activeFilters:", activeFilters); return activeFilters; } activeFilters = getActiveFacetsFromURL(); //console.log("activeFilters===============================================================================================================================================================", activeFilters); </script> <div class="WrappersectionBanner"> <div class="pageBannerWrapper page--pagelayout" style="float: unset; clear: both;"> <style> .sectionBanner { margin-bottom: 25px; width: 99.5vw; position: relative; left: 50%; right: 50%; margin-left: -50vw; margin-right: -50vw; opacity: 0; position: relative !important; min-height: 200px !important; } .sectionBanner .twothirds-column div{ overflow: hidden; } .sectionBanner .twothirds-column div img{ max-height: 400px; object-fit: fill; } </style> <!-- Full-width Class to allow content to go to the edge, SectionBanner Class allows content to have a consitaint banner across the website, Background Color is editable Here instead of in the CSS to allow us to change it --> <div class="full-width sectionBanner centeredText" ></div> </div> </div> <style> .WrappersectionBanner:has(img) { min-height: 425px !important; } .QuickLinks{ opacity: 0; transition: opacity 0.75s ease-in-out; margin-top: 20px; } .QuickLinks.loaded{ opacity: 1; transition: opacity 0.75s ease-in-out; } </style> <div class="QuickLinksWrapper" style="max-width: 1500px; overflow-x: hidden;"> <div class="QuickLinks"> <div class="QuickLinksafter"></div> </div> </div> <script> // https://www.demdaco.com/ const Quickbuttons_banners = { "_buy-with-prime_": "670d4680261040edaf982251", "_artist_": "65e629c27d6a5f033c1ad3fd", "_recipient_": "65415ff908e265ad2cd7d9eb", "recipient_wife": "67321dd197a1d56a2e6b0d8c", "recipient_teacher": "67321d892edeb4e406d1c4ad", "recipient_sister": "67321d2b07786c5f8402e7af", "recipient_mother": "67321bb249a760758c355907", "recipient_husband": "67321b687ba2fa59e591c6e6", "recipient_grandmother": "673219e849a760758c355886", "recipient_grandfather": "6732194d97a1d56a2e6b0982", "recipient_gifts-for-him": "673218cd57598f7c28b43eb6", "recipient_gifts-for-her": "6732184f57598f7c28b43eae", "recipient_friend": "6732176857598f7c28b43e83", "recipient_father": "673216f12edeb4e406d1c44b", "holiday_valentines-day": "673216944b7612bb0eecdd9c", "holiday_thanksgiving": "673214d19688c9028c4c2be9", "holiday_new-years": "67321437fc45c5c6a7a10366", "holiday_memorial-day": "6732135e223f318a2511325d", "holiday_halloween": "673213075d568af901884760", "holiday_grandparents-day": "673212526641f90d9cbcfca5", "holiday_fourth-of-july": "67321211412cadb91c4507f3", "holiday_fathers-day": "67321183412cadb91c4507e3", "holiday_easter": "6732110609fb7dc662028b97", "holiday_christmas": "67321003f85f077514840432", "class_storage": "67320f0d0f566eda76596054", "class_serveware": "67320e91728115594cfb571b", "class_purses-and-bags": "67320df20ab64d610466ac60", "class_plush": "67320d4361996a44a85394a3", "class_personal-accessories": "67320c7f728115594cfb5571", "class_outdoor-accessories": "67320c35728115594cfb5567", "class_office": "67320b99223f318a251131d0", "class_kitchen-linens": "67320b0c25a46d9bd1975255", "class_jewelry": "6732087a61fcd808a064bccb", "class_fragrance": "673207defc45c5c6a7a0f763", "class_drinkware": "67320750728115594cfb54e8", "class_decor": "673205eafc45c5c6a7a0f731", "class_baby-toys": "6732030e61996a44a8538f37", "class_bakeware": "673203915d568af901884621", "class_apparel": "673201731d50e31b0e434887" }; function addtrailingURL() { var path = window.location.pathname if (!path.endsWith('/')) { path += '/'; return path; } else { return path; } } document.addEventListener('DOMContentLoaded', () => { const currentPath = addtrailing(window.location.pathname); console.log(`Transformed path: ${currentPath}`); let bannerLoaded = false; // Flag variable to track if a banner has been loaded console.log("Banner loaded:", bannerLoaded); for (const key of Object.keys(Quickbuttons_banners)) { console.log(`Checking key: ${key}`); if (!bannerLoaded && currentPath.includes(key)) { const bannerID = Quickbuttons_banners[key]; console.log(`Match found: ${key} with ID ${bannerID}`); weblayer(currentPath, bannerID, () => { const quickLinks = document.querySelector('.QuickLinks'); if (quickLinks) { quickLinks.classList.add('loaded'); } console.log(`Banner for ${key} loaded with ID ${bannerID}`); }); bannerLoaded = true; // Set the flag to true to prevent further matches console.log("Banner loaded:", bannerLoaded); break; // Optional: Ensures the loop stops immediately after the first match } } if (!bannerLoaded) { console.log("No matching key found."); } }); </script> <script> window.onload = function() { // Your script here smoothBannerIn() }; document.addEventListener('DOMContentLoaded', (event) => { }); function smoothBannerIn() { let BannerImageWrapper = document.querySelector('.sectionBanner .twothirds-column div'); let WrapperBanner = document.querySelector('.pageBannerWrapper'); let banner = document.querySelector('.sectionBanner'); WrapperBanner.style.maxHeight = '0px'; WrapperBanner.style.transition = 'max-height 0.5s ease'; setTimeout(function(){ if(document.querySelector('.pageBannerWrapper').clientHeight > 300){ WrapperBanner.style.height = '400px'; } else { // WrapperBanner.style.height = '250px'; } WrapperBanner.style.maxHeight = '400px'; }, 500); } function addtrailing(path) { // Remove leading and trailing slashes let modifiedPath = path.startsWith('/') ? path.slice(1) : path; modifiedPath = modifiedPath.endsWith('/') ? modifiedPath.slice(0, -1) : modifiedPath; // Replace all '/' with '_' modifiedPath = modifiedPath.replace(/\//g, '_'); return modifiedPath; } let previousPath = addtrailing(window.location.pathname); let URLWebID = window.location.pathname; var layerBannerID = '66057e99b56f9d36551dd7ff'; var layerFooterSEOID = '65314e1e5f167429da77319f'; let footerSeoElement = document.getElementById('FooterSeo'); let bannerplp = document.querySelector('.sectionBanner'); let lastCallTimeContent = 0; async function handleSelectionFilterClick() { // Redefine your variable when the pathname changes const now = Date.now(); if (now - lastCallTimeContent < 1000) { // console.log("Function called too quickly, skipping this call."); return; } lastCallTimeContent = now; let URLWebID = window.location.pathname; console.log("New path:", URLWebID); let footerSeoElement = document.getElementById('FooterSeo'); let bannerplp = document.querySelector('.sectionBanner'); let currentPath = addtrailing(window.location.pathname); // Check if elements are not empty, if so clear them if (footerSeoElement.innerHTML !== '' || bannerplp.innerHTML !== '') { if (currentPath !== previousPath) { previousPath = currentPath; console.log("Elements are not empty. Clearing content."); footerSeoElement.innerHTML = ''; bannerplp.innerHTML = ''; // let banner = document.querySelector('.sectionBanner'); // banner.style.opacity = '0'; } } // If elements are empty, then proceed with weblayer calls if (footerSeoElement.innerHTML === '' && bannerplp.innerHTML === '') { console.log("Before weblayer calls"); let banner = document.querySelector('.sectionBanner'); banner.style.transition = 'opacity 0.5s ease-in-out'; banner.style.opacity = '0'; setTimeout(function() { banner.style.opacity = '1'; weblayer(addtrailing(window.location.pathname), layerBannerID, function() { setTimeout(function() { updateBanner(); console.log("Banner updated"); let WrapperBanner = document.querySelector('.pageBannerWrapper'); if(document.querySelector('.pageBannerWrapper').clientHeight > 300){ WrapperBanner.style.height = '400px'; } else { WrapperBanner.style.height = '350px'; } }, 100); }); }, 500); weblayer(addtrailing(window.location.pathname), layerFooterSEOID, function() { setTimeout(function() { getSeoData(); console.log("SEO data updated"); }, 100); }); // smoothBanneroOut() console.log("After weblayer calls"); } else { return handleSelectionFilterClick(); } } /* function weblayer(URLWebID, layerID, callback){ // accessible in the web layer as exponea.showWebLayer( layerID, { rowID: URLWebID + "", placement: "contentWeblayer" }, true, function(){ if (typeof callback === 'function') { callback(); } } ); } */ </script> <!-- <p class="metaDataTitle">meta Title here </p> --> <!-- <p class="CanonicalTitle">CanonicalTitle</p> --> <!-- <div style="height: 80px" class="subCategoryParent " id="desktopCategory" data-slick='{ "infinite": true, "slidesToShow": 7, "slidesToScroll": 1 }' > </div> --> <div id="customFacetsPage"> <p class="BreadcrumbsPLP"></p> <script> var facets = [ "topLevel", "format", "artist", "occasions", "holday", "recipient", "sentiment", "collection", "seasonality", "color", "indoorOutdoorUse", "age", "sizeGrouping", "room", "gender", "homeDecorStyle", "patternGroup", "animalVariety", "entertainWashMethod", "apparelMaterial", "closureType", "frameHoldsPhoto", "garmentTorsoLength", "orientation", "garmentSleeveLength", "itemPlacement", "garmentNeckline", "frameMaterial", "pantLength", "frameDisplayType", "batteryInformation", "gameType", "fashionStyle", "textileWashMethod", "textileDryMethod", "bagStructure", "bagShellMaterial", "exteriorFeatures", "interiorFeatures", "shape", "religious", "sale", "new", "seenInCatalog", "brand", "catalog" ] /* FORMAT ARTIST NAME COLLECTION NAME RECIPIENT OCCASION PRODUCT CATEGORY AGE GROUP CARE INSTRUCTIONS COLOR MATERIALS SALE */ </script> <div class="filters"> <div class="appliedFilters" > <div class="clearAll">Clear All</div> </div> <div class="actionsFilters"> <div class="mobileFilters" > <label class="form-label" for="filter" onclick="ToggleMobalFiltersOpen(true)">Filters & Sort By</label> </div> <!-- <div class="searchField"> --> <!-- searchPLP --> <!-- <input type="text" id="searchPLP" placeholder="Search for a Meaningful Product"> --> <!-- <div class="searchIcon" data-tooltip="Search for unique products with purpose"> </div> --> <!-- </div> --> <!-- <div class="imageSwap"> <div class="imageButton">Product</div> <div><b>|</b></div> <div class="imageButton">Lifestyle</div>A </div> --> <div class="productCount" style="display: none;"></div> <div class="countLimit" style="display: none;"> <label class="form-label" for="perPageSelect">Per Page:</label> <!-- Apply the custom-select class to the select element --> <select class="form-select custom-select" name="perPageSelect" id="perPageSelect"> <option value="20" selected>20</option> <option value="24">24</option> <option value="36">36</option> <option value="48">48</option> </select> </div> </div> </div> <div class="productListing"> <style> /* .hideDept{ display: none !important; } */ </style> <!-- wishlistProduct --> <div class="modalMobileFilters Mobilehide wishlistProduct"> <div class="modalMobileContainerFilters "> <div class="modalButton" style="position: fixed; bottom: 0px; z-index: 9999; background-color: #eee; width: 100%; text-align: center; padding: 10px;"> <p class="btn apply" onclick="ToggleMobalFiltersClose(); build();">See Results</p> </div> <div class="details filters"> <div class="actionsFilters" style="margin: 0px ;"> <div class="mobileButtonclose" style="width: 100%;" onclick="ToggleMobalFiltersClose(); build();"> <div class="closeButton"> </div> </div> <style> .search_plp { width: 100%; margin: 0; padding: 0; } #searchPLP { outline: unset !important; outline-offset: unset !important; } /* Focused state for the whole search field */ .searchField.focused { border: 2px solid #0f7fff; /* Change the border when focused */ outline: none; } /* Focused state for the icon button */ #iconButton.focused { border: 2px solid #0f7fff; border-radius: 50%; outline: none; } .searchField { position: relative; display: flex; align-items: center; border: 1px solid #888888; gap: 10px; } .iconButton { width: 40px; height: 100%; background-color: #2b2b2b !important; background-image: url(/content/icons/SearchIcon-01-white.svg) !important; background-size: 80%; background-repeat: no-repeat; background-position: center; cursor: pointer; transition: all 0.3s; position: absolute; right: 0px; border-radius: 50px; } .iconButton.clear { background-image: url('/content/icons/CloseIcon-01-white.svg') !important; background-color: #717171 !important; background-size: 40%; } .iconButton:hover { background-color: #717171 !important; transition: all 0.3s; } .searchField input { width: 100%; border: none; outline: none; } .searchField input::placeholder { color: #555555; font-weight: normal; } </style> <div class="search_plp"> <label class="form-label" for="searchPLP">Search</label> <div class="searchField"> <div class="iconButton" id="iconButton" data-tooltip="Search Within Selection"></div> <input type="text" id="searchPLP" name="searchPLP" placeholder="Search Within Selection"> </div> </div> <script> </script> <div class="sortBy" style="width: 100%;"> <label class="form-label" for="sort">Sort By</label> <select class="form-select" name="sort" id="sort"> <option value="FEATURED">Featured Items</option> <option value="NEWEST">Newest Items</option> <option value="BEST_SELLING" selected="">Best Selling</option> <option value="A_TO_Z">A to Z</option> <option value="Z_TO_A">Z to A</option> <option value="LOWEST_PRICE">Price: Ascending</option> <option value="HIGHEST_PRICE">Price: Descending</option> </select> </div> <div class="productCount" style="display: none;">1-12 0f 400 products</div> <div class="countLimit" style="display: none;"> <label class="form-label" for="perPageSelect">Per Page:</label> <select class="form-select custom-select" name="perPageSelect" id="perPageSelect"> <option value="20" selected>20</option> <option value="24">24</option> <option value="36">36</option> <option value="48">48</option> </select> </div> </div> <aside class="page-sidebar" id="faceted-search-container"> <div id="accordionGroup" class="accordion"> <button id="accordion-open-dept" class="accordion__button">Product Department<svg><use xlink:href="#icon-chevron-right"></use></svg></button> <div id="accordion-section-dept" class="accordion__section"> </div> <button id="accordion-open-class" class="accordion__button">Product Category<svg><use xlink:href="#icon-chevron-right"></use></svg></button> <div id="accordion-section-class" class="accordion__section"> </div> <button id="accordion-open-subclass" class="accordion__button hideDept" style="display: none;">Product Type<svg><use xlink:href="#icon-chevron-right" ></use></svg></button> <div id="accordion-section-subclass" class="accordion__section"> </div> <button id="accordion-open-collection" class="accordion__button">Collection<svg><use xlink:href="#icon-chevron-right"></use></svg></button> <div id="accordion-section-collection" class="accordion__section"> </div> <button id="accordion-open-artist" class="accordion__button">Artist<svg><use xlink:href="#icon-chevron-right"></use></svg></button> <div id="accordion-section-artist" class="accordion__section"> </div> <button id="accordion-open-occasion" class="accordion__button">Occasions<svg><use xlink:href="#icon-chevron-right"></use></svg></button> <div id="accordion-section-occasion" class="accordion__section"> </div> <button id="accordion-open-holiday" class="accordion__button">Holiday<svg><use xlink:href="#icon-chevron-right"></use></svg></button> <div id="accordion-section-holiday" class="accordion__section"> </div> <button id="accordion-open-recipient" class="accordion__button">Recipient<svg><use xlink:href="#icon-chevron-right"></use></svg></button> <div id="accordion-section-recipient" class="accordion__section"> </div> <button id="accordion-open-age" class="accordion__button">Age Group<svg><use xlink:href="#icon-chevron-right"></use></svg></button> <div id="accordion-section-age" class="accordion__section"> </div> <button id="accordion-open-sentiment" class="accordion__button">Sentiment<svg><use xlink:href="#icon-chevron-right"></use></svg></button> <div id="accordion-section-sentiment" class="accordion__section"> </div> <button id="accordion-open-seasonality" class="accordion__button">Seasonality<svg><use xlink:href="#icon-chevron-right"></use></svg></button> <div id="accordion-section-seasonality" class="accordion__section"> </div> <button id="accordion-open-color" class="accordion__button">Color<svg><use xlink:href="#icon-chevron-right"></use></svg></button> <div id="accordion-section-color" class="accordion__section"> </div> <button id="accordion-open-size-grouping" class="accordion__button">Fashion Size<svg><use xlink:href="#icon-chevron-right"></use></svg></button> <div id="accordion-section-size-grouping" class="accordion__section"> </div> <button id="accordion-open-room" class="accordion__button">Room<svg><use xlink:href="#icon-chevron-right"></use></svg></button> <div id="accordion-section-room" class="accordion__section"> </div> <button id="accordion-open-fragrance" class="accordion__button">Fragrance<svg><use xlink:href="#icon-chevron-right"></use></svg></button> <div id="accordion-section-fragrance" class="accordion__section"> </div> <button id="accordion-open-gender" class="accordion__button">Gender<svg><use xlink:href="#icon-chevron-right"></use></svg></button> <div id="accordion-section-gender" class="accordion__section"> </div> <button id="accordion-open-pattern" class="accordion__button">Patterns<svg><use xlink:href="#icon-chevron-right"></use></svg></button> <div id="accordion-section-pattern" class="accordion__section"> </div> <button id="accordion-open-animal-variety" class="accordion__button">Animal Variety<svg><use xlink:href="#icon-chevron-right"></use></svg></button> <div id="accordion-section-animal-variety" class="accordion__section"> </div> <button id="accordion-open-apparel-material" class="accordion__button">Apparel Material<svg><use xlink:href="#icon-chevron-right"></use></svg></button> <div id="accordion-section-apparel-material" class="accordion__section"> </div> <button id="accordion-open-bracelet-closure-type" class="accordion__button">Bracelet Closure Type<svg><use xlink:href="#icon-chevron-right"></use></svg></button> <div id="accordion-section-bracelet-closure-type" class="accordion__section"> </div> <button id="accordion-open-frame-holds-photo" class="accordion__button">Frame Size<svg><use xlink:href="#icon-chevron-right"></use></svg></button> <div id="accordion-section-frame-holds-photo" class="accordion__section"> </div> <button id="accordion-open-garment-sleeve-length" class="accordion__button">Garment Sleeve Length<svg><use xlink:href="#icon-chevron-right"></use></svg></button> <div id="accordion-section-garment-sleeve-length" class="accordion__section"> </div> <button id="accordion-open-item-placement" class="accordion__button">Item Placement<svg><use xlink:href="#icon-chevron-right"></use></svg></button> <div id="accordion-section-item-placement" class="accordion__section"> </div> <button id="accordion-open-garment-neckline" class="accordion__button">Garment Neckline<svg><use xlink:href="#icon-chevron-right"></use></svg></button> <div id="accordion-section-garment-neckline" class="accordion__section"> </div> <button id="accordion-open-frame-materials" class="accordion__button">Frame Material<svg><use xlink:href="#icon-chevron-right"></use></svg></button> <div id="accordion-section-frame-materials" class="accordion__section"> </div> <button id="accordion-open-pant-length" class="accordion__button">Pant Length<svg><use xlink:href="#icon-chevron-right"></use></svg></button> <div id="accordion-section-pant-length" class="accordion__section"> </div> <button id="accordion-open-frame-orientation" class="accordion__button">Frame Display Type<svg><use xlink:href="#icon-chevron-right"></use></svg></button> <div id="accordion-section-frame-orientation" class="accordion__section"> </div> <button id="accordion-open-battery-information" class="accordion__button">Battery Information<svg><use xlink:href="#icon-chevron-right"></use></svg></button> <div id="accordion-section-battery-information" class="accordion__section"> </div> <button id="accordion-open-game-type" class="accordion__button">Game Type<svg><use xlink:href="#icon-chevron-right"></use></svg></button> <div id="accordion-section-game-type" class="accordion__section"> </div> <button id="accordion-open-fashion-style" class="accordion__button">Fashion Style<svg><use xlink:href="#icon-chevron-right"></use></svg></button> <div id="accordion-section-fashion-style" class="accordion__section"> </div> <button id="accordion-open-bag-structure" class="accordion__button">Bag Structure<svg><use xlink:href="#icon-chevron-right"></use></svg></button> <div id="accordion-section-bag-structure" class="accordion__section"> </div> <button id="accordion-open-bag-shell-material" class="accordion__button">Bag Shell Material<svg><use xlink:href="#icon-chevron-right"></use></svg></button> <div id="accordion-section-bag-shell-material" class="accordion__section"> </div> <button id="accordion-open-exterior-features" class="accordion__button">Exterior Features<svg><use xlink:href="#icon-chevron-right"></use></svg></button> <div id="accordion-section-exterior-features" class="accordion__section"> </div> <button id="accordion-open-shape" class="accordion__button">Shape<svg><use xlink:href="#icon-chevron-right"></use></svg></button> <div id="accordion-section-shape" class="accordion__section"> </div> <button id="accordion-open-sale" class="accordion__button">Sale<svg><use xlink:href="#icon-chevron-right"></use></svg></button> <div id="accordion-section-sale" class="accordion__section"> </div> <button id="accordion-open-new" class="accordion__button">New<svg><use xlink:href="#icon-chevron-right"></use></svg></button> <div id="accordion-section-new" class="accordion__section"> </div> <button id="accordion-open-brand" class="accordion__button">Brand<svg><use xlink:href="#icon-chevron-right"></use></svg></button> <div id="accordion-section-brand" class="accordion__section"> </div> <button id="accordion-open-as-seen-in" class="accordion__button">As Seen In<svg><use xlink:href="#icon-chevron-right"></use></svg></button> <div id="accordion-section-as-seen-in" class="accordion__section"> </div> <button id="accordion-open-buy-with-prime" class="accordion__button">Buy With Prime<svg><use xlink:href="#icon-chevron-right"></use></svg></button> <div id="accordion-section-buy-with-prime" class="accordion__section"> </div> <div class="priceSearch"> <div id="priceLabel" class="accordion__button"> Shop By Price </div> <div class="accordion__price open"> </div> <div id="priceFilters"> <div class="input-group"> <label for="minPrice">Min Price:</label> <div class="input-with-symbol"> <span class="currency-symbol">$</span> <input type="text" id="minPrice" placeholder="Min Price" aria-label="Minimum price" > </div> </div> <span>-</span> <div class="input-group"> <label for="maxPrice">Max Price:</label> <div class="input-with-symbol"> <span class="currency-symbol">$</span> <input type="text" id="maxPrice" placeholder="Max Price" aria-label="Maximum price" > </div> </div> </div> <button class="cBTN gray--Radius--outlineHover--BTN" id="applyButtonPriceSearch">Apply</button> </div> </div> </aside> </div> </div> </div> <script> const searchPLP = document.getElementById('searchPLP'); const iconButton = document.getElementById('iconButton'); const searchField = document.querySelector('.searchField'); // When the input field is focused searchPLP.addEventListener('focus', () => { searchField.classList.add('focused'); }); // When the input field loses focus searchPLP.addEventListener('blur', () => { searchField.classList.remove('focused'); }); // When the icon button is focused iconButton.addEventListener('focus', () => { iconButton.classList.add('focused'); }); // When the icon button loses focus iconButton.addEventListener('blur', () => { iconButton.classList.remove('focused'); }); function addClassObject(classListObj, imageList) { // Convert native DOM object to a jQuery object const classSlider = $(document.querySelector(".subCategoryParent")); // console.log('Is slick initialized: ', classSlider.hasClass('slick-initialized')); // Assuming classListObj has a "Class" key containing an array of objects const classList = mergedFilters.find(obj => 'Class' in obj)?.Class; // If there's only one object in the array, exit the function early if (Array.isArray(classList) == false || classList?.length <= 1) { return; } // Remove existing slides for (let i = slideIndex - 1; i >= 0; i--) { classSlider.slick('slickRemove', i); } slideIndex = 0; // Add new slides classList.forEach(element => { const key = Object.keys(element)[0]; // Get the key (e.g., "apparel", "baby", etc.) //const imageSrc = imageList[key]; // Get the image source from imageList classSlider.slick('slickAdd', ` <div style="padding: 0px 15px;"> <div class="pillBTN-PLP" style="width: 100%; display: inline-block;"> <p style="text-align: center; text-transform: uppercase;"><a style="text-decoration: none;" href="/shop-by/class/${key}" tabindex="-1"> ${key.replace(/-/g, ' ')} </a> </p> </div> </div> `); slideIndex++; } ); } // Get the accordion button const accordionButtondept = document.getElementById("accordion-open-dept"); const sectiondept = document.querySelector("#accordion-open-subclass"); const isExpanded = sectiondept.classList.contains("expanded"); // Check if the "expanded" class is present initially sectiondept.classList.add("hideDept"); // Function to toggle the class when "expanded" class is added function toggleHideDeptOnExpanded() { if (sectiondept.classList.contains("expanded")) { sectiondept.classList.remove("hideDept"); } } // Example: Simulate adding the "expanded" class setInterval(() => { toggleHideDeptOnExpanded(); }, 500); accordionButtondept.addEventListener("click", () => { const filtersDept = document.getElementById("accordion-section-dept").querySelectorAll('.selectionFilter'); filtersDept.forEach(filterDept => { filterDept.addEventListener("change", (event) => { // // console.log("this has changed =========================================================="); // // console.log(sectiondept); // Toggle the .hideDept class sectiondept.classList.toggle("hideDept"); }); }); }); let accordionButtons = document.querySelectorAll('.accordion__button'); // Function to close all accordion sections function closeAllAccordions() { accordionButtons.forEach(button => { button.classList.remove('expanded'); button.setAttribute('aria-expanded', false); const associatedSectionId = button.getAttribute('id').replace('open', 'section'); const associatedSection = document.querySelector('#' + associatedSectionId); associatedSection.classList.remove('open'); associatedSection.setAttribute('aria-hidden', true); }); } // Event listener for each accordion button accordionButtons.forEach(buttonAcc => { buttonAcc.setAttribute('aria-expanded', false); const associatedSectionId = buttonAcc.getAttribute('id').replace('open', 'section'); const associatedSection = document.querySelector('#' + associatedSectionId); buttonAcc.addEventListener('click', () => { if (!buttonAcc.classList.contains('expanded')) { // Close all accordions before opening the clicked one closeAllAccordions(); // Open the clicked accordion buttonAcc.classList.add('expanded'); buttonAcc.setAttribute('aria-expanded', true); associatedSection.classList.add('open'); associatedSection.setAttribute('aria-hidden', false); } else { // Close the clicked accordion buttonAcc.classList.remove('expanded'); buttonAcc.setAttribute('aria-expanded', false); associatedSection.classList.remove('open'); associatedSection.setAttribute('aria-hidden', true); } }); }); // Start of code function extractCustomFieldsNew(customFieldsCollectArry, keysToCollect) { let fieldCounts = {}; let result = []; // Define the keys you are interested in const keysSet = new Set(keysToCollect); for (let product of customFieldsCollectArry) { let customFieldsEdges = product.node.customFields.edges; for (let customField of customFieldsEdges) { let key = customField.node.name; let value = customField.node.value; // Only process keys that you are interested in if (keysSet.has(key)) { if (fieldCounts[key]) { if (fieldCounts[key][value]) { fieldCounts[key][value]++; } else { fieldCounts[key][value] = 1; } } else { fieldCounts[key] = {}; fieldCounts[key][value] = 1; } } } } for (let key in fieldCounts) { let valueObjects = []; for (let value in fieldCounts[key]) { valueObjects.push({ [value]: fieldCounts[key][value] }); } result.push({ [key]: valueObjects }); } // //{attribute: "seedProduct", values: ["yes"]} return result; } let productIdsArry = []; // Global array to store product IDs function productIdsArryFun(customFieldsCollectArry) { for (let product of customFieldsCollectArry) { if (product && product.node && product.node.entityId) { productIdsArry.push(String(product.node.entityId)); } else { console.error("Product structure is not as expected, Check the productIdsArryFun function to see if you are getting the correct data. can be caused GraphQL query use var customFieldsCollectArry see"); } } result = productIdsArry return result; } function customFields(afterCursor){ let afterArgument = afterCursor ? ', after: "' + afterCursor + '"' : ''; let query = ` query { site { search { searchProducts(filters: { hideOutOfStock: true, productAttributes:[${att}] }) { products(first: ${50} ${afterArgument} ) { edges { node { entityId customFields { edges { node { name value } } } } } pageInfo { hasNextPage hasPreviousPage startCursor endCursor } } } } } }`; return query; } // end of code function removeFilter(filterName, filterValue) { updateURLWithFacets(activeFilters); } function getActiveFacetsFromURL() { const segments = window.location.pathname.split('/'); activeFilters = []; for (let i = 2; i < segments.length; i += 2) { const key = segments[i] ? segments[i].replace(/-/g, ' ') : ''; const value = segments[i + 1] ? segments[i + 1].replace(/-/g, ' ') : ''; let filter = activeFilters.find(f => f.attribute.toLowerCase() === key.toLowerCase()); if (!filter) { filter = { attribute: key, values: [] }; activeFilters.push(filter); } filter.values.push(value); } return activeFilters; } function onPopStateHandler(callback) { window.onpopstate = (event) => { if (event.state) { callback(event.state); } }; } function formatFacetValue(value) { value = value.replace(/-/g, ' '); value = value.toLowerCase().split(' ').map((word, index) => { if (index === 0 || index === 1) { return word.charAt(0).toUpperCase() + word.slice(1); } return word; }).join(' '); value = value.replace(/\band\b/gi, '&'); return value; } function ListedFacets(values, key) { let facetsHTML = ''; values.forEach(value => { const valueKey = Object.keys(value)[0]; const isActive = activeFilters.some(filter => filter.key === key && filter.value.includes(valueKey)); const checkedAttribute = isActive ? 'checked' : ''; // Function to capitalize the first and second letters and replace dashes with spaces let facet = ` <div data-key="${key}" data-value="${valueKey}" class="selectionFilter"> <input ${checkedAttribute} data-filtername="${key}" type="checkbox" id="${valueKey}" name="${valueKey}"> <label for="${valueKey}"> ${formatFacetValue(valueKey)} </label> </div> `; facetsHTML += facet; }); return facetsHTML; } function setAccordionInitialState() { // Select all accordion sections const accordionSections = document.querySelectorAll('.accordion__section'); // Convert NodeList to Array to use reverse method const sectionsArray = Array.from(accordionSections).reverse(); let lastCheckedSectionOpened = false; let isAnySectionAlreadyOpen = false; // First, check if any section is already open accordionSections.forEach(section => { if (section.classList.contains('open')) { isAnySectionAlreadyOpen = true; } }); sectionsArray.forEach(section => { const id = section.id.split('accordion-section-')[1]; const button = document.getElementById(`accordion-open-${id}`); // Check if any sub-input is checked within the section const anyChecked = section.querySelectorAll('input[type="checkbox"]:checked').length > 0; if (!isAnySectionAlreadyOpen) { if (anyChecked && !lastCheckedSectionOpened) { // Open the section and button, and mark as the last opened section.classList.add('open'); section.setAttribute('aria-hidden', 'false'); if (button) { button.classList.add('expanded'); button.setAttribute('aria-expanded', 'true'); } lastCheckedSectionOpened = true; // Prevent opening any other checked sections } else { // Close the section and button section.classList.remove('open'); section.setAttribute('aria-hidden', 'true'); if (button) { button.classList.remove('expanded'); button.setAttribute('aria-expanded', 'false'); } } } }); } // this is a large function can use some refactoring but what it does is it takes the active filters and builds the function buildAccordManual(ArraySelections){ // console.log(ArraySelections) const accordionSections = document.querySelectorAll('.accordion__section'); accordionSections.forEach(section => { //section.setAttribute('aria-hidden', true) //section.classList.remove('open') }) ArraySelections.sort((a, b) => { let aName = Object.keys(a)[0].toLowerCase(); let bName = Object.keys(b)[0].toLowerCase(); let aIndex = orderList.indexOf(aName); let bIndex = orderList.indexOf(bName); if (aIndex === -1 && bIndex === -1) { return aName.localeCompare(bName); } if (aIndex === -1) return 1; if (bIndex === -1) return -1; return aIndex - bIndex; }); document.querySelectorAll('.accordion__section').forEach((section) => { section.innerHTML = ''; }); ArraySelections.forEach(facet => { let facetName = Object.keys(facet)[0]; let facetValues = facet[facetName]; // Sort facetValues alphabetically by their keys facetValues.sort((a, b) => { const keyA = Object.keys(a)[0].toLowerCase(); const keyB = Object.keys(b)[0].toLowerCase(); return keyA.localeCompare(keyB); }); const AccordSection = document.getElementById(`accordion-section-${facetName.toLowerCase()}`); if (AccordSection !== null) { AccordSection.insertAdjacentHTML("beforeEnd", ListedFacets(facetValues, facetName.toLowerCase())); } else { } }); accordionSections.forEach((section) => { // Extract the variable part from section's ID const idTokens = section.id.split('accordion-section-'); const relevantIdPart = idTokens.length > 1 ? idTokens[1] : null; if (relevantIdPart) { // Construct the corresponding button's ID const buttonId = `accordion-open-${relevantIdPart.toLowerCase()}`; const correspondingButton = document.getElementById(buttonId); // Check if section is empty if (section.innerHTML.trim() === '') { // Hide the section and button section.style.display = 'none'; if (correspondingButton) { correspondingButton.style.display = 'none'; } } else { // Make sure the section and button are visible section.style.display = 'block'; if (correspondingButton) { correspondingButton.style.display = 'flex'; } } } }); setAccordionInitialState() // Get all facet containers (assuming they have a class of accordion__section) const facetContainers = document.querySelectorAll('.accordion__section'); // Assume facetContainers is a NodeList or Array of your container elements. facetContainers.forEach(container => { // Get all selectionFilters within this container const filters = container.querySelectorAll('.selectionFilter'); let isChecked = false; // Loop through each filter to find checkboxes within them filters.forEach((filter) => { const childCheckboxes = filter.querySelectorAll('input[type="checkbox"]'); childCheckboxes.forEach((checkbox) => { if (checkbox.checked) { isChecked = true; } }); }); // Only proceed to add "See More" button if none of the child checkboxes are checked, // and if there are more than 10 filters if (!isChecked && filters.length > 10) { // Hide all but the first 10 filters initially for (let i = 10; i < filters.length; i++) { filters[i].style.display = 'none'; } // Create and append the "See More" button const showMoreButton = document.createElement('button'); showMoreButton.innerText = 'See More'; showMoreButton.addEventListener('click', function() { // Show all hidden filters for (let i = 10; i < filters.length; i++) { filters[i].style.display = 'block'; } // Remove the 'See More' button showMoreButton.style.display = 'none'; }); container.appendChild(showMoreButton); } }); } async function fetchAndBuildProductAttributes(removedFilter) { try { async function setupPage() { await collectFacets(); buildAccordManual(mergedFilters); runAfter() view_category() let checkboxes = document.querySelectorAll('.selectionFilter input[data-filtername]'); checkboxes.forEach(checkbox => { checkbox.addEventListener('change', function(event) { const filterName = event.target.getAttribute('data-filtername'); // console.log(filterName); updateActiveFilters(filterName, event.target.id, event.target.checked); sortByUrlUpdate() updatePriceRangeURL() build(1); updateURLWithFacets(); }); }); } setupPage() } catch (error) { console.error(`An error occurred: ${error}`); } if(removedFilter){ // console.log(removedFilter) } } function ToggleMobalFiltersOpen(open){ if (open) { document.querySelector('.modalMobileFilters').classList.remove('Mobilehide') document.querySelector('body').style.overflow = 'hidden'; // console.log('Modal opened Toggled'); } else { } // document.querySelector('.modalMobileFilters').classList.remove('Mobilehide') // // console.log('Modal opened Toggled'); } function ToggleMobalFiltersClose(){ document.querySelector('.modalMobileFilters').classList.add('Mobilehide') document.querySelector('body').style.overflow = 'auto'; // console.log('Modal closed'); } document.querySelector('.mobileFilters').addEventListener('click', () => { // ToggleMobalFiltersOpen() }) // Start of code async function customFieldsCollection(callCount = 0) { let afterCursorCustom = '' return new Promise(async (resolve, reject) => { try { if (callCount >= maxCalls) { resolve(customFieldsCollectArry); return; } await GraphQLCall(customFields(afterCursorCustom)).then(data => { CustomCallData = data customFieldsCollectArry.push(...data.data.site.search.searchProducts.products.edges); if (data.data.site.search.searchProducts.products.pageInfo.hasNextPage) { afterCursorCustom = data.data.site.search.searchProducts.products.pageInfo.endCursor; ArraySelections = customFieldsCollectArry resolve(customFieldsCollection(callCount + 1)); } else { ArraySelections = customFieldsCollectArry resolve(customFieldsCollectArry); } }); } catch (error) { reject(error); } }); } // let DefaultFiltersDebug =[] async function collectFacets() { customFieldsCollectArry = [] ArraySelections = await customFieldsCollection(0); FiltersSet = extractCustomFieldsNew(ArraySelections, keysToCollect) mergedFilters = [] try { //console.log(DefaultFilters) // let DefaultFiltersDebug = DefaultFilters; let convertedDefaultFilters = DefaultFilters.map(item => { const name = item.node.name; let attributes; // Declare `attributes` here for broader scope if (item.node.attributes != undefined) { attributes = item.node.attributes.edges.map(edge => { return { [edge.node.value]: edge.node.productCount }; }); } else { attributes = []; // Assign a default value (e.g., an empty array) to handle the else case } return { [name]: attributes }; }); // console.log(convertedDefaultFilters); // console.log(FiltersSet) mergedFilters = [...FiltersSet, ...convertedDefaultFilters]; // console.log(mergedFilters) addClassObject(mergedFilters.find(obj => 'Class' in obj), imageList) // console.log(mergedFilters); } catch (error) { console.error("An error occurred:", error); } } async function collectFacetsOLD() { customFieldsCollectArry = [] ArraySelections = await customFieldsCollection(0); FiltersSet = extractCustomFieldsNew(ArraySelections, keysToCollect) mergedFilters = [] try { const convertedDefaultFilters = DefaultFilters.map(item => { const name = item.node.name; // console.log(name) const attributes = item.node.attributes.edges.map(edge => { return { [edge.node.value]: edge.node.productCount }; }); // console.log(attributes) return { [name]: attributes }; }); // console.log(convertedDefaultFilters) // console.log(FiltersSet) mergedFilters = [...FiltersSet, ...convertedDefaultFilters]; // console.log(mergedFilters) addClassObject(mergedFilters.find(obj => 'Class' in obj), imageList) // console.log(mergedFilters); } catch (error) { console.error("An error occurred:", error); } } function createFilterOption(Option) { const value = Option.node ? Option.node.value : Object.keys(Option)[0]; return ` <div class="filterOption"> <input type="checkbox" id="${value}" name="${value}" value="${value}"> <label for="${value}">${value}</label> </div>`; } function createFilterGroup(Filter) { const name = Filter.node ? Filter.node.name : Object.keys(Filter)[0]; const attributes = Filter.node ? Filter.node.attributes.edges : Filter[name]; const optionsHTML = attributes.map(createFilterOption).join(''); return ` <div class="filterGroup"> <div class="filterTitle">${name}</div> <div class="filterOptions">${optionsHTML}</div> </div>`; } function additionalFacets(facetNumber, subFacetNumber){ if(atob(facetNumber) == 'arrayconnection:1'){ callFacets(facetNumber); }else{ callFacets(btoa('arrayconnection:' + facetNumber), subFacetNumber) } } function callFacets(AfterFacetCusor, facetCusor = ""){ let setAfterfacetNumber = ', after:' + facetNumber let setAfterAfterFacetCusor = facetCusor ? ', after:' + facetCusor : ''; facetsAdditions = `query { site { search { searchProducts( filters: { hideOutOfStock: true, ${searchFor()} productAttributes:[${att}] } sort: ${sortBySelection()} ) { filters(first: 1 ${facetNumber}) { edges { node { ... on ProductAttributeSearchFilter { __typename name filterName displayProductCount attributes(first: 50 ${setAfterAfterFacetCusor}) { edges { node { value productCount isSelected } cursor } pageInfo { hasNextPage hasPreviousPage startCursor endCursor } } isCollapsedByDefault } name } cursor } pageInfo { startCursor hasPreviousPage hasNextPage endCursor } } } } } }` } </script> <script type="text/javascript"> // Initialize the flag outside the function let hasViewedCategory = false; // Function to track category view function view_category() { if (hasViewedCategory) { // If the function has already run, exit early return; } // Set the flag to true to prevent future executions hasViewedCategory = true; // Your existing logic let category_1 = ""; let category_2 = ""; let category_3 = ""; // Iterate over activeFilters to find and set the categories activeFilters.forEach(filter => { if (filter.key === "dept" && filter.value.length > 0) { category_1 = filter.value[0]; } else if (filter.key === "class" && filter.value.length > 0) { category_2 = filter.value[0]; } else if (filter.key === "subclass" && filter.value.length > 0) { category_3 = filter.value[0]; } }); // Construct categories_path let categories_path = [category_1, category_2, category_3].filter(Boolean).join(" > "); var categoryData = { category_id: window.location.pathname.replace(/^\/|\/$/g, '').replace(/\//g, '_'), category_name: window.location.pathname, category_listed_products: productIdsArryFun(customFieldsCollectArry), category_1: category_1, category_2: category_2, category_3: category_3, categories_path: categories_path, local_currency: 'USD', language: "en", location: window.location.pathname }; exponea.track('view_category', categoryData); } // Function to reset the flag when a checkbox is clicked function resetViewCategoryFlag() { hasViewedCategory = false; // Optionally, you can call view_category here if you want to track immediately after the checkbox is clicked // view_category(); } // Add event listeners to all checkboxes document.addEventListener('DOMContentLoaded', () => { // Assuming checkboxes have a specific class, e.g., 'filter-checkbox' const checkboxes = document.querySelectorAll('.filter-checkbox'); checkboxes.forEach(checkbox => { checkbox.addEventListener('click', resetViewCategoryFlag); }); // Optionally, run view_category once on page load view_category(); }); </script> <div class="productCategoies"> <ul id="startMoreProducts" class="productGridFacets"> </ul> <style> .productsPLP { display: none !important; grid-template-columns: repeat(4, minmax(250px, 1fr)); gap: 20px; flex-wrap: wrap; margin: 20px 0px 50px 0px; padding: 20px 20px; border: 1px solid rgba(229, 229, 229, 0.975); list-style: none; border-radius: 5px; box-shadow: 0px 0px 5px 3px rgba(229, 229, 229, 0.96); li{ box-sizing: border-box; } } @media (max-width: 1550px) { .productsPLP { grid-template-columns: repeat(3, minmax(250px, 1fr)); } } @media (max-width: 1300px) { .productsPLP { grid-template-columns: repeat(3, minmax(200px, 1fr)); } } @media (max-width: 1100px) { .productsPLP { grid-template-columns: repeat(3, minmax(175px, 1fr)); } } @media (max-width: 1000px) { .productsPLP li:nth-child(1){ grid-column: 1 / span 2; text-align: center; } .productsPLP { grid-template-columns: repeat(2, minmax(150px, 1fr)); padding-left: 20px !important; padding-right: 20px !important; } } </style> <ul class="productsPLP" style="display: none !important;"> <li> <!-- <h3 style="margin-top: 0px !important; font-size: 28px;">Looks Like we are Out of Stock</h3> --> <p>Explore items based on your interests.</p> <!-- <a href="https://www.demdaco.com/" style="max-width: 300px; margin: 0px auto;" class="cBTN gray--Radius--outlineHover--BTN">See More</a> --> </li> </ul> <script> let recsProductsEmptyPLP = []; function QureyBuiltrecsEmptyPLP(productsRecsArrayEmptyPLP) { productsRecs = `query { site { products(entityIds: [${productsRecsArrayEmptyPLP}], first: 11) { edges { node { id sku name path customFields { edges { node { name value } } } defaultImage { img320px: url(width: 320) img640px: url(width: 640) img960px: url(width: 960) img1280px: url(width: 1280) altText } addToCartUrl addToWishlistUrl prices { price { value } salePrice { value } } entityId createdAt { utc } } } } } }`; return productsRecs; } function buildRecsEmptyPLP(productDataEmptyPLP) { let listedDocuments = document.querySelector('.productsPLP'); productDataEmptyPLP.forEach(product => { listedDocuments.insertAdjacentHTML('beforeend', ` <li id="${product.node.entityId}" data-sku="${product.node.sku}" class="productCard" data-product-id="${product.node.entityId}"> <div class="productImage"> <button style="display: none;" class="button button--small card-figcaption-button AddtoCartBTN" data-product-id="${product.node.entityId}" data-sku="${product.node.sku}">Add To Cart</button> <button class="button button--small card-figcaption-button quickview" data-product-id="${product.node.entityId}" data-sku="${product.node.sku}">Quick view</button> <form class="AddtoCart ProductFormOptions" method="post" style="display: none;"> <button class="DecreaseCart" data-action="dec">-</button> <input class="quantyCart qty" min="1" name="qty" pattern="[0-9]*" type="tel" value="1"> <button class="IncreaseCart" data-action="inc">+</button> <input name="action" type="hidden" value="add"> <input name="product_id" type="hidden" value="99965"> <div style="display: none;"> <input class="form-action-addToCart" type="submit" value="Add to Cart"> </div> </form> <a href="${product.node.path}"> <img src="${product && product.node && product.node.defaultImage && product.node.defaultImage.img640px ? product.node.defaultImage.img640px : 'https://placehold.co/620x620/000000/FFF'}" alt=""> </a> </div> <div class="productDetails"> <div class="midRow"> <p class="productTitle">${product.node.name}</p> </div> </div> </li> `) }) } function buildCatalogFiltersEmptyPLP(filters) { var filterToUse = filters.length >= 2 ? filters[1] : filters[0]; var key = filterToUse.key; var onlyOneValue = filterToUse.value[0]; var catalogFilters = [{ 'property': "category_1", 'constraint': { 'type': 'string', 'operator': 'equals', 'operands': [ { 'type': 'constant', 'value': "home" }]}}]; return catalogFilters; } var PLACEMENTEmptyPLP = "EmptyPLP"; // var recommendation_idEmptyPLP = "65fdaf1e4f0fb4e107d50a80"; var recommendation_idEmptyPLP = "660711dd58ba72fc3a95b8f3"; var RCM_STATUSEmptyPLP = 0; let productsRecsArrayEmptyPLP = []; var onRecommendationsLoadedEmptyPLP = function (ProductsDataEmptyPLP) { if (RCM_STATUSEmptyPLP !== "TIMED_OUT") { RCM_STATUSEmptyPLP = "LOADED"; if (ProductsDataEmptyPLP && ProductsDataEmptyPLP.length > 11) { console.log("list of products to recommend " + JSON.stringify(ProductsDataEmptyPLP)); for (var i = 0; i < ProductsDataEmptyPLP.length; i++) { if (productsRecsArrayEmptyPLP.length >= 11) { break; } var item = ProductsDataEmptyPLP[i]; console.log(item.product_id); productsRecsArrayEmptyPLP.push(item.product_id); console.log("list of products to recommend " + JSON.stringify(productsRecsArrayEmptyPLP)); } } else {} } GraphQLCall(QureyBuiltrecsEmptyPLP(productsRecsArrayEmptyPLP)) .then(data => { recsProductsEmptyPLP = data.data.site.products.edges; buildRecsEmptyPLP(recsProductsEmptyPLP); }) .catch(error => { console.error("Failed to Build Products Page Review Build Function", error); }); }; var optionsRecsEmptyPLP = { recommendationId: recommendation_idEmptyPLP, size: 50, callback: onRecommendationsLoadedEmptyPLP, fillWithRandom: true, //catalogFilter: buildCatalogFiltersEmptyPLP(activeFilters), // Adds additional constrains to catalog when retrieving recommended items. Example: [{'property': 'gender', 'constraint': { 'type': 'string', 'operator': 'equals', 'operands': [{'type': 'constant', 'value': 'male'}]}}] catalogAttributesWhitelist: [], // Returns only specified attributes from catalog items. If empty or not set, returns everything. }; setTimeout(function () { if(plpProducts.length > 0){ console.log("Products are not empty. Hide Recommendations."); } else { document.querySelector('.productsPLP').style.display = 'none'; exponea.getRecommendation(optionsRecsEmptyPLP); document.querySelector('.productRecommendations').style.display = 'none'; } }, 1000); </script> <!-- <style> .productRecommendations { display: grid; grid-template-columns: repeat(4, minmax(250px, 1fr)); gap: 20px; flex-wrap: wrap; margin: 20px 0px 50px 0px; padding: 20px 20px; border: 1px solid rgba(229, 229, 229, 0.975); list-style: none; border-radius: 5px; box-shadow: 0px 0px 5px 3px rgba(229, 229, 229, 0.96); li{ box-sizing: border-box; } } </style> <ul class="productRecommendations"> <li> <h3 style="margin-top: 0px !important; font-size: 28px;">Recommended for You, Handpicked Selection</h3> <p>Explore items based on your interests.</p> </li> </ul> <script> let recsProducts = []; function QureyBuiltrecs(productsRecsArray) { productsRecs = `query { site { products(entityIds: [${productsRecsArray}], first: 3) { edges { node { id sku name path customFields { edges { node { name value } } } defaultImage { img320px: url(width: 320) img640px: url(width: 640) img960px: url(width: 960) img1280px: url(width: 1280) altText } addToCartUrl addToWishlistUrl prices { price { value } salePrice { value } } entityId createdAt { utc } } } } } }`; return productsRecs; } function buildRecs(productData) { let listedDocuments = document.querySelector('.productRecommendations'); productData.forEach(product => { listedDocuments.insertAdjacentHTML('beforeend', ` <li id="${product.node.entityId}" data-sku="${product.node.sku}" class="productCard" data-product-id="${product.node.entityId}"> <div class="productImage"> <button style="display: none;" class="button button--small card-figcaption-button AddtoCartBTN" data-product-id="${product.node.entityId}" data-sku="${product.node.sku}">Add To Cart</button> <button class="button button--small card-figcaption-button quickview" data-product-id="${product.node.entityId}" data-sku="${product.node.sku}">Quick view</button> <form class="AddtoCart ProductFormOptions" method="post" style="display: none;"> <button class="DecreaseCart" data-action="dec">-</button> <input class="quantyCart qty" min="1" name="qty" pattern="[0-9]*" type="tel" value="1"> <button class="IncreaseCart" data-action="inc">+</button> <input name="action" type="hidden" value="add"> <input name="product_id" type="hidden" value="99965"> <div style="display: none;"> <input class="form-action-addToCart" type="submit" value="Add to Cart"> </div> </form> <a href="${product.node.path}"> <img src="${product && product.node && product.node.defaultImage && product.node.defaultImage.img640px ? product.node.defaultImage.img640px : 'https://placehold.co/620x620/000000/FFF'}" alt=""> </a> </div> <div class="productDetails"> <div class="midRow"> <p class="productTitle">${product.node.name}</p> </div> </div> </li> `) }) } function buildCatalogFilters(filters) { var filterToUse = filters.length >= 2 ? filters[1] : filters[0]; var key = filterToUse.key; var onlyOneValue = filterToUse.value[0]; var catalogFilters = [{ 'property': key, 'constraint': { 'type': 'string', 'operator': 'equals', 'operands': [ { 'type': 'constant', 'value': onlyOneValue }]}}]; return catalogFilters; } var PLACEMENT = "homepage"; // var recommendation_id = "65fc734c03a1cde3be57da7c"; var recommendation_id = "65fc734c03a1cde3be57da7c"; var RCM_STATUS = 0; productsRecsArray = []; var onRecommendationsLoaded = function (ProductsData) { if (RCM_STATUS !== "TIMED_OUT") { RCM_STATUS = "LOADED"; if (ProductsData && ProductsData.length > 3) { for (var i = 0; i < ProductsData.length; i++) { if (productsRecsArray.length >= 3) { break; } var item = ProductsData[i]; console.log(item.product_id); productsRecsArray.push(item.product_id); } } else {} } GraphQLCall(QureyBuiltrecs(productsRecsArray)) .then(data => { recsProducts = data.data.site.products.edges; buildRecs(recsProducts); }) .catch(error => { console.error("Failed to Build Products Page Review Build Function", error); }); }; var optionsRecs = { recommendationId: recommendation_id, size: 10, callback: onRecommendationsLoaded, fillWithRandom: true, catalogFilter: buildCatalogFilters(activeFilters), // Adds additional constrains to catalog when retrieving recommended items. Example: [{'property': 'gender', 'constraint': { 'type': 'string', 'operator': 'equals', 'operands': [{'type': 'constant', 'value': 'male'}]}}] catalogAttributesWhitelist: [], // Returns only specified attributes from catalog items. If empty or not set, returns everything. }; setTimeout(function () { exponea.getRecommendation(optionsRecs); }, 500); </script> --> <div> <!-- <style> .productRecommendations { display: grid; grid-template-columns: repeat(4, minmax(250px, 1fr)); gap: 20px; flex-wrap: wrap; margin: 20px 0px 50px 0px; padding: 20px 20px; border: 1px solid rgba(229, 229, 229, 0.975); list-style: none; border-radius: 5px; box-shadow: 0px 0px 5px 3px rgba(229, 229, 229, 0.96); li{ box-sizing: border-box; } } </style> <ul class="productRecommendations"> <li> <h3 style="margin-top: 0px !important; font-size: 28px;">Recommended for You, Handpicked Selection</h3> <p>Explore items based on your interests.</p> </li> </ul> <script> let recsProducts = []; // Genreal Call function GraphQLCall(Query) { return fetch("/graphql", { method: 'POST', credentials: 'include', mode: 'cors', headers: { 'Content-Type': 'application/json', 'Authorization': 'Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJFUzI1NiJ9.eyJjaWQiOlsxXSwiY29ycyI6WyJodHRwczovL3d3dy5kZW1kYWNvLmNvbSJdLCJlYXQiOjE3NDA3NTAwNjMsImlhdCI6MTc0MDU3NzI2MywiaXNzIjoiQkMiLCJzaWQiOjk5OTcxOTY2Niwic3ViIjoiQkMiLCJzdWJfdHlwZSI6MCwidG9rZW5fdHlwZSI6MX0.u79r7CpDX4T61cYP3ugBA_Ba7dvOCquqmlMvq9R9pgZR_ayX88blVMO2YpN4C1BHw0KAf8XX6XLqFB2890PDYA' }, body: JSON.stringify({ query: Query }), }).then(res => res.json()) } function getRandomFacetFromURL() { const url = window.location.href; // Get current URL const urlSegments = url.split('/'); const facets = []; // Assuming URL follows the pattern http://172.16.42.233:3010/shop-by/facet1/value1/facet2/value2 // So we start at index 5, and skip every other index for (let i = 5; i < urlSegments.length; i += 2) { const cleanedFacet = urlSegments[i].replace(/-/g, ' '); // Replace dashes with spaces facets.push(cleanedFacet); } if (facets.length > 0) { const randomIndex = Math.floor(Math.random() * facets.length); return facets[randomIndex]; } return "home decor"; // Default value } function QureyBuiltrecs(activeFilters) { //{attribute: "${filter.attribute}", values: ${''}} productsRecs = `query { site { search { searchProducts(filters: { searchTerm: "${getRandomFacetFromURL()}" }) { products(first: 3) { edges { node { id entityId name sku path customFields { edges { node { name value } } } defaultImage { img320px: url(width: 320) img640px: url(width: 640) img960px: url(width: 960) img1280px: url(width: 1280) altText } prices { price { value currencyCode } retailPrice { value currencyCode } } addToCartUrl availabilityV2 { ... on ProductAvailable { status } ... on ProductPreOrder { status willBeReleasedAt { utc } } ... on ProductUnavailable { status } status } brand { name id entityId defaultImage { altText isDefault url(width: 640) urlOriginal } } giftWrappingOptions { edges { node { name allowComments } } } depth { value unit } height { unit value } images { edges { node { altText isDefault url(width: 640) urlOriginal } cursor } } metafields(namespace: "digitalFormats") { edges { node { entityId id key value } } } inventory { aggregated { availableToSell warningLevel } isInStock hasVariantInventory } minPurchaseQuantity productOptions { edges { cursor node { isRequired displayName isVariantOption } } } showCartAction weight { unit value } width { unit value } warranty } cursor } collectionInfo { totalItems } pageInfo { hasPreviousPage hasNextPage endCursor startCursor } } } } } }`; return productsRecs; } GraphQLCall(QureyBuiltrecs()) .then(data => { // document.querySelector('.productGridFacets').innerHTML = ""; recsProducts = data.data.site.search.searchProducts.products.edges; buildRecs(recsProducts); }) .catch(error => { console.error("Failed to Build Products Page Review Build Function", error); }); function buildRecs(productData) { let listedDocuments = document.querySelector('.productRecommendations'); productData.forEach(product => { listedDocuments.insertAdjacentHTML('beforeend', ` <li id="${product.node.entityId}" data-sku="${product.node.sku}" class="productCard" data-product-id="${product.node.entityId}"> <div class="productImage"> <div class="flags"> ${isNew(product.node.customFields.edges, "Format", 'Plate', `<div class="flag-primary-new">Plate</div>`, ``)} </div> <div class="wishlistAdd"> <div class="dropdownWishlist"> <form action="/wishlist.php?action=add&product_id=${product.node.entityId}" class="form form-action" data-wishlist-add method="post"> <select class="" name="" data-dropdown-content id="wishlist-dropdown${product.node.entityId}"> ${ListedWishlists(product.node.entityId)} <option value="Add to Wish List" selected="">Add to Wish List</option> <option data-wishlist="" href="wishlist.php?action=add&product_id=${product.node.entityId}" role="button" value="Create New Wish List">Create New Wish List</option> </select> </form> </div> <div class="iconWishlist"> <img src="https://store-kmr73o5t54.mybigcommerce.com/content/icons/newIcons/icon-wishlist.svg" alt="Add to Wishlist"> </div> </div> <button class="button button--small card-figcaption-button AddtoCartBTN" data-product-id="${product.node.entityId}" data-sku="${product.node.sku}">Add To Cart</button> <form class="AddtoCart ProductFormOptions" method="post"> <button class="DecreaseCart" data-action="dec">-</button> <input class="quantyCart qty" min="1" name="qty" pattern="[0-9]*" type="tel" value="1"> <button class="IncreaseCart" data-action="inc">+</button> <input name="action" type="hidden" value="add"> <input name="product_id" type="hidden" value="99965"> <div style="display: none;"> <input class="form-action-addToCart" type="submit" value="Add to Cart"> </div> </form> <button class="button button--small card-figcaption-button quickview" data-product-id="${product.node.entityId}" data-sku="${product.node.sku}">Quick view</button> <a href="${product.node.path}"> <img src="${product && product.node && product.node.defaultImage && product.node.defaultImage.img640px ? product.node.defaultImage.img640px : 'https://placehold.co/620x620/000000/FFF'}" alt=""> </a> </div> <div class="productDetails"> <div class="midRow"> <p class="productTitle">${product.node.name}</p> </div> <div class="topRow"> <p>${formatCurrency(product.node.prices.price.value)}</p> <div class="review"> <div class="yotpo bottomLine" data-product-id="${product.node.entityId}" data-sku="${product.node.sku}"></div> </div> </div> <div class="bottomRow"> <div class="tags" style='display: none; '> <p>10.5' X 5'</p> <p>10.5' X 5'</p> <p>10.5' X 5'</p> </div> <div class="callout" style='display: flex;'> ${isCallout(product.node.prices.price.value, '<img src="https://store-kmr73o5t54.mybigcommerce.com/content/icons/newIcons/freeShippingIconSolid.svg" alt="Shipping Icon"><p>Free Shipping!</p>')} </div> <div class="colors" style='display: none; '> <div data-color="#2b2b2b" class="color"></div> <div data-color="#2b2b2b" class="color"></div> <div data-color="#2b2b2b" class="color"></div> <div data-color="#2b2b2b" class="color"></div> </div> </div> </div> </li> `) }) // runAfter() } </script> --> </div> <div class="upsellBlockPLP"></div> <script> document.addEventListener('DOMContentLoaded', function() { var BRUpsellPLP = "65fd9007e79424044c04bbc4"; weblayer(addtrailing(window.location.pathname), BRUpsellPLP, function() { console.log("SEO data updated"); }); }); </script> <!-- 660437be43d3c204f61ff6a9 --> <ul id="MoreProducts" class="productGridFacets"></ul> <div id="FooterSeo"></div> </div> </div> </div> </div> <div id="modal" class="modal" data-reveal data-prevent-quick-search-close> <a href="#" class="modal-close" aria-label="Close" role="button"> <span aria-hidden="true">×</span> </a> <div class="modal-content"></div> <div class="loadingOverlay"></div> </div> <div id="alert-modal" class="modal modal--alert modal--small" data-reveal data-prevent-quick-search-close> <div class="alert-icon error-icon"> <span class="icon-content"> <span class="line line-left"></span> <span class="line line-right"></span> </span> </div> <div class="alert-icon warning-icon"> <div class="icon-content">!</div> </div> <div class="modal-content"></div> <div class="button-container"> <button type="button" class="confirm button" data-reveal-close>Ok</button> <button type="button" class="cancel button" data-reveal-close>Cancel</button> </div> </div> </div> </main> <footer class="footer" role="contentinfo" id="footerContent"> <div class="footer-bottom"> <div class="container"> <section class="footer-info"> <article class="footer-info-col footer-info-about"> <h3 aria-hidden="true" class="footer-info-heading">ABOUT US</h3> <ul role="list" class="footer-info-list"> <li role="listitem" ><a href="/our-story/">Our Story</a></li> <li role="listitem" ><a href="/blog/">Blog</a></li> <li role="listitem" ><a href="https://www.demdaco.com/blog/?tag=as%20seen%20in">Press</a></li> <li role="listitem" ><a href="/career-opportunities/">Careers</a></li> <li role="listitem" ><a href="/gift-wrap/">Gift Box</a></li> <li role="listitem" ><a href="/catalog/">Catalogs</a></li> <li role="listitem"><a href="https://www.demdaco.com/catalog-request/"><li> Request Catalog</li></a> <li role="listitem" ><a href="/product-reviews/">Product Reviews</a></li> <li role="listitem" ><a href="/site-reviews/">Site Reviews</a></li> </ul> </article> <article class="footer-info-col footer-info-support"> <h3 aria-hidden="true" class="footer-info-heading">SUPPORT</h3> <ul role="list" class="footer-info-list"> <li role="listitem" ><a href="/customer-support/">Customer Service</a></li> <li role="listitem" ><a rel="nofollow" href="/account.php?action=order_status">Track Your Order</a></li> <li role="listitem" ><a href="/shipping-returns/">Shipping & Returns</a></li> <li role="listitem" ><a href="/promotions/">Promotions</a></li> <li role="listitem" ><a href="/faqs/">FAQs</a></li> <li role="listitem" ><a href="/recall-information/">Recall Information</a></li> <li role="listitem" ><a href="/store-locator/">Store Locator</a></li> <li role="listitem" ><a href="/demdaco-affiliate-sign-up/">Affiliate Sign-Up</a></li> <li role="listitem" ><a href="https://www.demdacoretailers.com/login.php?action=create_account">Become a Retailer</a></li> </ul> </article> <article class="footer-info-col footer-info-contact"> <div class="footer-info-storeinfo"> <h3 aria-hidden="true" class="footer-info-heading">CONTACT US</h3> <div class="phone-div"> <p><a aria-label="Contacts us by phone monday - friday, 8am - 5pm CT Phone Number is 888.336.3226" href="tel:+18883363226">888.336.3226</a> <span>Mon - Fri, 8am - 12pm & 12:30pm - 5pm CT</span></p> </div> <div class="email-div"> <p><a href="mailto:customersupport@demdaco.com">customersupport@demdaco.com</a></p> </div> <h3 aria-hidden="true" class="footer-info-heading" style="margin-top: 20px;">Santa's Kindness Ornament </h3> <div class="email-div"> <p><a href="mailto:customersupport@demdaco.com ">CustomerSupport@demdaco.com </a></p> <p>Phone: 888.336.3226</p> <p>Hours: Mon - Fri, 8am - 12pm & 12:30pm - 5pm CT</p> </div> <a href="https://www.demdaco.com/information-center/#FAQs" class="font-weight-bold HolidayRed--Radius--outlineHover--BTN cBTN px-5 py-1 text-center" style="margin: 20px 0px; display: inline-flex;">Santa's Kindness FAQS</a> </div> </article> <article class="footer-info-col footer-info-newsletter"> <div class="footer-info-storeinfo"> <div class="newsletter-div"> <h3 aria-hidden="true" class="footer-info-heading">STAY CONNECTED</h3> <p>Receive special offers and get the latest updates.</p> <form name="ProfileFormFooter" method="get"> <div class="form-field "> <div class="form-prefixPostfix wrap"> <input aria-required="true" aria-label="Your Email Address" class="form-input" type="text" id="SubmitFooter" name="inp_3" size="40" maxlength=255 value="" placeholder="Your email address" > <input class="gray-button" aria-label='Sign Up' tabindex='993' type="submit" name="submit1" value="Sign Up"> <input tabindex='882' type=checkbox name="optin" value="y" checked="true" style="display: none;" > </div> </div> <div class="confirmationHidden emailconfirm" style="display: none;"> <div class="alertBox alertBox--success" > <div class="alertBox--success-img"><img class="__mce_add_custom__" title="success" src="https://cdn11.bigcommerce.com/s-v4ii6tetn2/product_images/uploaded_images/tick.png" alt="success"></div> <p class="alertBox-column alertBox-message" ><span>Thank You! Your email has been recorded.</span></p> </div> </div> </form> </div> <div> <ul class=""> <!-- The toolHover and data-tooltip are Javascript/CSS solutions to show information for ADA --> <li class="socialLinks-item"> <!-- Facebook Link --> <a aria-label="Icon Linking to DEMDACO Facebook" style="margin: 20px 10px 0px 0px; text-decoration: none; width: 35px;height: 35px;" class="icon toolHover" data-tooltip="Check out our Facebook" href="https://www.facebook.com/demdaco/" target="_blank"> <img height="auto" width="35px" src="https://store-kmr73o5t54.mybigcommerce.com/content/supportImages/Facebook.jpg"> </a> <!-- Instagram Link --> <a aria-label="Icon Linking to DEMDACO Instagram" style="margin: 20px 10px 0px 10px; text-decoration: none; width: 35px;height: 35px;" class="icon toolHover" data-tooltip="Check out our Instagram" href="https://www.instagram.com/demdaco/?hl=en" target="_blank"> <img height="auto" width="35px" src="https://store-kmr73o5t54.mybigcommerce.com/content/supportImages/Instagram.jpg"> </a> <!-- Pinterest Link --> <a aria-label="Icon Linking to DEMDACO Pinterest" style="margin: 20px 10px 0px 10px; text-decoration: none; width: 35px;height: 35px;" class="icon toolHover" data-tooltip="Check out our Pinterest" href="https://www.pinterest.com/demdaco/_created/" target="_blank"> <img height="auto" width="35px" src="https://store-kmr73o5t54.mybigcommerce.com/content/supportImages/Pinterest.jpg"> </a> </li> </ul> </div> </div> <a href="/blog/"><img style="margin-top: 15px;" src="https://store-kmr73o5t54.mybigcommerce.com/content/blog/blog_covers/OurBlog-web.jpg" width="150px" height="auto"></a> </article> </section> <p class="visible-m ada-icon" ><a target="_blank" href="https://www.essentialaccessibility.com/Demdaco?utm_source=demdacohomepage&utm_medium=iconlarge&utm_term=eachannelpage&utm_content=header&utm_campaign=Demdaco"><img src="https://store-kmr73o5t54.mybigcommerce.com/content/eA_Icon-01.svg" alt="This icon serves as a link to download the eSSENTIAL Accessibility assistive technology app for individuals with physical disabilities. It is featured as part of our commitment to diversity and inclusion."></a></p> <div class="footer-copyright"> <!-- <ul> <li><a href="/shop-by/recipient/mom/?_bc_fsnf=1&Availability=IN%20STOCK&sort=bestselling">Mother's Day Gifts</a></li> <li><a href="/shop-by/occasion/fathers-day/?_bc_fsnf=1&Availability=IN%20STOCK&sort=bestselling">Father's Day Gifts</a></li> <li><a href="/shop-by/holiday/easter/?_bc_fsnf=1&Availability=IN%20STOCK&sort=bestselling">Easter Basket Ideas</a></li> <li><a href="/shop-by/interest/garden-nature/?_bc_fsnf=1&Availability=IN%20STOCK&sort=bestselling">Gifts For the Gardener</a></li> </ul><br> --> <p class="powered-by">© DEMDACO 2005-2025 All Rights Reserved.</p> <ul role="list" > <!--<li role="listitem" ><a href="/privacy-policy/">Privacy Policy</a></li> --> <li role="listitem" ><a href="/privacy-statement/">Privacy Statement</a></li> <li role="listitem" ><a href="https://privacy.demdaco.com/consumer/index">Do Not Sell My Personal Information</a></li> <li role="listitem" ><a href="/accessibility-statement/">Accessibility Statement</a></li> <li role="listitem" ><a href="/terms-and-conditions/">Terms and Conditions</a></li> <li role="listitem" ><a href="/gcc-cpsia-compliance/">GCC-CPSIA Compliance</a></li> <li role="listitem" ><a href="/sitemap.php">Site Map</a></li> </ul> </div> </div> </div> </footer> <div class='cookie-banner' style='display: none'> <p>I agree to the storing of cookies on my device to enhance site navigation, analyze site usage, and assist in our marketing efforts. <a href="https://privacy.demdaco.com/consumer/index" target="_blank">Do Not Sell My Personal information</a> </p> <button class='close'>Agree</button> </div> <script type="text/javascript"> $(document).ready(function(){ if(localStorage.getItem('cookieSeen') != 'shown'){ $(".cookie-banner").delay(2000).fadeIn(); localStorage.setItem('cookieSeen','shown') } $('.close').click(function(e) { $('.cookie-banner').fadeOut(); }); }); </script> <script type="text/javascript"> $(window).scroll(function () { if ($(window).scrollTop() > 110){ $('header').addClass('sticky'); $('#mainContent').css('padding-top',$('.inner-header').outerHeight()) } else if ($(window).scrollTop() <= 100) { $('header').removeClass('sticky'); $('#mainContent').css('padding-top',0) } }); $(".search-div .is-srOnly").click(function(){ $(".form-field").slideToggle(); }); $(".artistcategory .LeftCategories ul li.firstlevel > .icon").click(function(){ $(this).parent().toggleClass('active'); $(this).next(".subnavList").slideToggle(); }); $(document).ready(function() { $(".back-arw").hide(); //$(".navPage-subMenu").hide(); $(document).on('click', '.custom_toggle .toggle_btn', function(e){ e.preventDefault(); $('.custom_toggle .toggle_btn').removeClass('is-open'); $('.toggle_content.is-active').removeClass('is-active').slideUp(); $(this).addClass('is-open'); $(this).next('.toggle_content').addClass('is-active').slideDown(); }); }); </script> <!-- Header Nav [CLOSE] --> <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.9.0/slick.js"></script> <script type="text/javascript"> var categorynm = ''; console.log(categorynm); if(categorynm){ $.ajax({ url: "https://dev-demdaco.stage-codal.net/index.php/api/v1/b2ccategoryslider?category="+categorynm, method: "GET", contentType: false, success: function (data) { if(data!=''){ $('#categorySlider').css({'display':'block'}); } $('#categorySlider').append(data); $('#categorySlider').html( $('.brandGrid', $(data)).html() ); $('#categorySlider').slick({ "dots": true, "infinite": false, "mobileFirst": true, "arrows": true, "slidesToShow": 3, "slidesToScroll": 3, "responsive": [ { "breakpoint": 1279, "settings": { "slidesToShow": 3, "slidesToScroll": 3 } }, { "breakpoint": 599, "settings": { "slidesToShow": 3, "slidesToScroll": 3 } }, { "breakpoint": 0, "settings": { "slidesToShow": 2, "slidesToScroll": 2 } } ] }); }, error: function (e) { console.log(e); } }); } </script> <script> function AddReadMore() { var carLmt = 200; var readMoreTxt = "Read More"; var readLessTxt = "Read Less"; $(".addReadMore").each(function() { if ($(this).find(".firstSec").length) return; var allstr = $(this).text(); if (allstr.length > carLmt) { var firstSet = allstr.substring(0, carLmt); var secdHalf = allstr.substring(carLmt, allstr.length); var strtoadd = firstSet + "<span class='SecSec'>" + secdHalf + "</span><span class='readMore' title='Click to Show More'>" + readMoreTxt + "</span><span class='readLess' title='Click to Show Less'>" + readLessTxt + "</span>"; $(this).html(strtoadd); } }); $(document).on("click", ".readMore,.readLess", function() { $(this).closest(".addReadMore").toggleClass("showlesscontent showmorecontent"); }); } $(function() { AddReadMore(); }); </script> <script> // $( document ).ready(function() { // setTimeout(function(){ // $( document ).ready(function() { // document.querySelectorAll(".navPages a.navPages-action").forEach(function(tag){ // if(tag.getAttribute('href') != 'javascript:void(0);'){ // tag.setAttribute("href", tag.getAttribute('href') + "?_bc_fsnf=1&in_stock=1" ) // } // }) // }); // }, 1000); // }); </script> <script> document.querySelector('form[name="ProfileFormFooter"]').addEventListener('submit', function(e) { e.preventDefault(); var email = document.querySelector('form[name="ProfileFormFooter"] input[name="inp_3"]').value.toLowerCase().trim();; var emailRegex = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/; if (!emailRegex.test(email)) { alert("Please enter a valid email address"); } else{ // Show the confirmation message document.querySelector('.confirmationHidden').style.display = 'block'; document.querySelector('.newsletter-div .form-field').style.display = 'none'; exponea.identify( {'email_id': email },{ "email": email }); exponea.track('consent', { "email_id": email, "timestamp": Date.now(), "action": "accept", "category": "Email Optin", "valid_until": "unlimited", "source": "footer", }); } }); </script> <script> function fetchCartId(callback) { let options = { method: 'GET', headers: {'Content-Type': 'application/json'} }; fetch('/api/storefront/carts', options) .then(response => response.json()) .then(response => { if (response && response.length > 0) { callback(response[0].id); } else { console.log("No cart found"); callback(null); } }) .catch(err => console.error(err)); } function cartUpdateAdd() { fetchCartId(cartId => { if (cartId) { fetchCartData(cartId, 'add'); } }); } function cartUpdateRemove() { fetchCartId(cartId => { if (cartId) { fetchCartData(cartId, 'remove'); } }); } const productQueryDataCart = (entityId) => `query { site { product(entityId: ${entityId}) { id name sku brand { name entityId id } prices { price { value } } path customFields { edges { node { value name } } } entityId } } }`; function fetchCartData(cartId, action) { let ptotalQuantityCart = 0; let pproduct_listArryCart = []; let product_listIDArryCart = []; fetch(`/api/storefront/carts/${cartId}`, { credentials: 'include' }).then(response => response.json()).then(cartJson => { processCartData(cartJson, action, ptotalQuantityCart, pproduct_listArryCart, product_listIDArryCart); }).catch(error => { console.error('Error fetching cart data:', error); }); } function processCartData(cartData, action, ptotalQuantityCart, pproduct_listArryCart, product_listIDArryCart) { console.log('Updated Cart Data:', cartData); cartData.lineItems.physicalItems.forEach(item => { ptotalQuantityCart += item.quantity; pproduct_listArryCart.push({ "product_id": item.productId, "quantity": item.quantity }); product_listIDArryCart.push(item.productId); }); product_listIDArryCart.forEach(itemId => { GraphQLCall(productQueryDataCart(itemId)).then(data => { cart_updateEvent(data, cartData, action, ptotalQuantityCart, pproduct_listArryCart); }).catch(error => { console.error(`Error fetching product data for item ${itemId}:`, error); }); }); } function cart_updateEvent(product, cartData, action, ptotalQuantityCart, pproduct_listArryCart) { const productDetails = product.data.site.product; const productItem = { action: action, product_id: productDetails.entityId, title: productDetails.name, brand: productDetails.brand.name, price: productDetails.prices.price.value, price_local_currency: productDetails.prices.price.value, original_price: productDetails.prices.price.value, original_price_local_currency: productDetails.prices.price.value, product_list: pproduct_listArryCart, product_ids: pproduct_listArryCart.map(item => item.product_id), total_quantity: ptotalQuantityCart, total_price: cartData.baseAmount, total_price_local_currency: cartData.baseAmount, local_currency: 'USD', category_1: findCustomFieldValue(productDetails.customFields, 'dept'), category_2: findCustomFieldValue(productDetails.customFields, 'class'), category_3: findCustomFieldValue(productDetails.customFields, 'subclass'), categories_path: `${findCustomFieldValue(productDetails.customFields, 'dept')} > ${findCustomFieldValue(productDetails.customFields, 'class')} > ${findCustomFieldValue(productDetails.customFields, 'subclass')}`, variant_list: pproduct_listArryCart.map(item => ({ variant_id: item.product_id, quantity: item.quantity })), language: 'en', location: window.location.href, }; // console.log('Product Item:', productItem); exponea.track('cart_update', productItem); } function findCustomFieldValue(customFields, fieldName) { const field = customFields.edges.find(edge => edge.node.name === fieldName); return field ? field.node.value : null; } </script> <script>window.__webpack_public_path__ = "https://cdn11.bigcommerce.com/s-kmr73o5t54/stencil/34f13a70-71fa-013d-d0ed-6e3ef077b7cf/e/18cdf900-d520-013d-6672-2a37379de8c6/dist/";</script> <script src="https://cdn11.bigcommerce.com/s-kmr73o5t54/stencil/34f13a70-71fa-013d-d0ed-6e3ef077b7cf/e/18cdf900-d520-013d-6672-2a37379de8c6/dist/theme-bundle.main.js"></script> <script> window.stencilBootstrap("404", "{\"themeSettings\":{\"optimizedCheckout-formChecklist-color\":\"#333333\",\"homepage_new_products_column_count\":4,\"card--alternate-color--hover\":\"#ffffff\",\"optimizedCheckout-colorFocus\":\"#4496f6\",\"fontSize-root\":14,\"show_accept_amex\":false,\"optimizedCheckout-buttonPrimary-borderColorDisabled\":\"transparent\",\"homepage_top_products_count\":0,\"paymentbuttons-paypal-size\":\"responsive\",\"optimizedCheckout-buttonPrimary-backgroundColorActive\":\"#000000\",\"brandpage_products_per_page\":15,\"color-secondaryDarker\":\"#cccccc\",\"navUser-color\":\"#333333\",\"color-textBase--active\":\"#757575\",\"social_icon_placement_bottom\":\"bottom_none\",\"show_powered_by\":true,\"show_accept_amazonpay\":false,\"fontSize-h4\":18,\"checkRadio-borderColor\":\"#cccccc\",\"color-primaryDarker\":\"#333333\",\"optimizedCheckout-buttonPrimary-colorHover\":\"#ffffff\",\"brand_size\":\"190x250\",\"optimizedCheckout-logo-position\":\"left\",\"optimizedCheckout-discountBanner-backgroundColor\":\"#e5e5e5\",\"color-textLink--hover\":\"#757575\",\"pdp-sale-price-label\":\"\",\"optimizedCheckout-buttonSecondary-backgroundColorHover\":\"#f5f5f5\",\"optimizedCheckout-headingPrimary-font\":\"Google_Montserrat_400\",\"logo_size\":\"original\",\"optimizedCheckout-formField-backgroundColor\":\"#ffffff\",\"footer-backgroundColor\":\"#ffffff\",\"navPages-color\":\"#333333\",\"productpage_reviews_count\":9,\"optimizedCheckout-step-borderColor\":\"#888888\",\"show_accept_paypal\":false,\"paymentbuttons-paypal-label\":\"checkout\",\"paymentbuttons-paypal-shape\":\"pill\",\"optimizedCheckout-discountBanner-textColor\":\"#333333\",\"pdp-retail-price-label\":\"\",\"optimizedCheckout-buttonPrimary-font\":\"Google_Montserrat_400\",\"optimizedCheckout-backgroundImage-size\":\"1000x400\",\"pdp_sold_out_label\":\"\",\"carousel-dot-color\":\"#333333\",\"button--disabled-backgroundColor\":\"#cccccc\",\"blockquote-cite-font-color\":\"#999999\",\"optimizedCheckout-formField-shadowColor\":\"transparent\",\"categorypage_products_per_page\":15,\"container-fill-base\":\"#ffffff\",\"paymentbuttons-paypal-layout\":\"vertical\",\"homepage_featured_products_column_count\":4,\"button--default-color\":\"#666666\",\"pace-progress-backgroundColor\":\"#999999\",\"color-textLink--active\":\"#757575\",\"ItemOneImage\":\"\",\"optimizedCheckout-loadingToaster-backgroundColor\":\"#333333\",\"color-textHeading\":\"#555555\",\"show_accept_discover\":false,\"optimizedCheckout-formField-errorColor\":\"#d14343\",\"spinner-borderColor-dark\":\"#999999\",\"restrict_to_login\":false,\"input-font-color\":\"#555555\",\"select-bg-color\":\"#ffffff\",\"show_accept_mastercard\":false,\"show_custom_fields_tabs\":false,\"color_text_product_sale_badges\":\"#ffffff\",\"optimizedCheckout-link-font\":\"Google_Montserrat_400\",\"homepage_show_carousel_arrows\":false,\"supported_payment_methods\":[\"card\",\"paypal\",\"bank\"],\"carousel-arrow-bgColor\":\"#ffffff\",\"lazyload_mode\":\"lazyload+lqip\",\"carousel-title-color\":\"#444444\",\"show_accept_googlepay\":false,\"card--alternate-borderColor\":\"#ffffff\",\"homepage_new_products_count\":0,\"button--disabled-color\":\"#ffffff\",\"color-grey\":\"#999999\",\"body-font\":\"Google_Source+Sans+Pro_400\",\"optimizedCheckout-step-textColor\":\"#ffffff\",\"paymentbuttons-paypal-accelerated-content-font-weight\":\"400\",\"carousel-play-pause-button-textColor--hover\":\"#474747\",\"color_hover_product_sale_badges\":\"#000000\",\"color-primaryDark\":\"#666666\",\"pdp_sale_badge_label\":\"\",\"optimizedCheckout-buttonPrimary-borderColorActive\":\"transparent\",\"navPages-subMenu-backgroundColor\":\"#e5e5e5\",\"button--primary-backgroundColor\":\"#555555\",\"optimizedCheckout-formField-borderColor\":\"#cccccc\",\"checkRadio-color\":\"#333333\",\"show_product_dimensions\":false,\"optimizedCheckout-link-color\":\"#476bef\",\"card-figcaption-button-background\":\"#ffffff\",\"icon-color-hover\":\"#999999\",\"button--default-borderColor\":\"#cccccc\",\"optimizedCheckout-headingSecondary-font\":\"Google_Montserrat_400\",\"headings-font\":\"Google_Montserrat_400\",\"label-backgroundColor\":\"#cccccc\",\"button--primary-backgroundColorHover\":\"#888888\",\"pdp-non-sale-price-label\":\"\",\"button--disabled-borderColor\":\"transparent\",\"label-color\":\"#ffffff\",\"optimizedCheckout-headingSecondary-color\":\"#555555\",\"select-arrow-color\":\"#757575\",\"logo_fontSize\":28,\"alert-backgroundColor\":\"#ffffff\",\"optimizedCheckout-logo-size\":\"250x100\",\"default_image_brand\":\"img/BrandDefault.gif\",\"card-title-color\":\"#333333\",\"carousel-arrow-color--hover\":\"#474747\",\"product_list_display_mode\":\"grid\",\"optimizedCheckout-link-hoverColor\":\"#002fe1\",\"paymentbanners-cartpage-logo-type\":\"primary\",\"fontSize-h5\":16,\"product_size\":\"500x659\",\"paymentbuttons-paypal-color\":\"gold\",\"homepage_show_carousel\":false,\"optimizedCheckout-body-backgroundColor\":\"#ffffff\",\"carousel-arrow-borderColor\":\"#ffffff\",\"button--default-borderColorActive\":\"#757575\",\"header-backgroundColor\":\"#ffffff\",\"paymentbuttons-paypal-tagline\":false,\"color_badge_product_sold_out_badges\":\"#007dc6\",\"color-greyDarkest\":\"#000000\",\"color_badge_product_sale_badges\":\"#007dc6\",\"price_ranges\":true,\"productpage_videos_count\":8,\"color-greyDark\":\"#666666\",\"optimizedCheckout-buttonSecondary-borderColorHover\":\"#999999\",\"optimizedCheckout-discountBanner-iconColor\":\"#333333\",\"optimizedCheckout-buttonSecondary-borderColor\":\"#cccccc\",\"optimizedCheckout-loadingToaster-textColor\":\"#ffffff\",\"ItemThreeImage\":\"\",\"optimizedCheckout-buttonPrimary-colorDisabled\":\"#ffffff\",\"optimizedCheckout-formField-placeholderColor\":\"#999999\",\"navUser-color-hover\":\"#757575\",\"icon-ratingFull\":\"#757575\",\"default_image_gift_certificate\":\"img/GiftCertificate.png\",\"color-textBase--hover\":\"#757575\",\"color-errorLight\":\"#ebd6d3\",\"social_icon_placement_top\":false,\"blog_size\":\"600x789\",\"shop_by_price_visibility\":true,\"optimizedCheckout-buttonSecondary-colorActive\":\"#000000\",\"paymentbanners-proddetailspage-color\":\"white\",\"color-warningLight\":\"#9a3324\",\"show_product_weight\":true,\"paymentbuttons-provider-sorting\":[\"paypal\",\"amazonpay\"],\"optimizedCheckout-orderSummary-backgroundColor\":\"#ffffff\",\"button--default-colorActive\":\"#000000\",\"masterpass-button-color\":\"black\",\"color-info\":\"#425563\",\"paymentbuttons-paypal-accelerated-content-font-family\":\"Montserrat, Arial, Helvetica, sans-serif\",\"show_product_quick_view\":true,\"button--default-borderColorHover\":\"#999999\",\"card--alternate-backgroundColor\":\"#ffffff\",\"hide_content_navigation\":true,\"amazon-button-color\":\"Gold\",\"optimizedCheckout-formChecklist-backgroundColorSelected\":\"#f5f5f5\",\"pdp-price-label\":\"\",\"show_copyright_footer\":true,\"swatch_option_size\":\"22x22\",\"optimizedCheckout-orderSummary-borderColor\":\"#dddddd\",\"optimizedCheckout-show-logo\":\"none\",\"carousel-description-color\":\"#333333\",\"fontSize-h2\":32,\"optimizedCheckout-step-backgroundColor\":\"#757575\",\"ItemFiveImage\":\"\",\"optimizedCheckout-formChecklist-backgroundColor\":\"#ffffff\",\"color-textBase\":\"#333333\",\"color-warning\":\"#9a3324\",\"paymentbuttons-paypal-accelerated-content-color\":\"white\",\"productgallery_size\":\"285x285\",\"carousel-play-pause-button-textColor\":\"8f8f8f\",\"optimizedCheckout-headingPrimary-color\":\"#555555\",\"alert-color\":\"#333333\",\"shop_by_brand_show_footer\":false,\"card-figcaption-button-color\":\"#333333\",\"paymentbuttons-paypal-accelerated-content-label\":\"checkout\",\"searchpage_products_per_page\":15,\"color-textSecondary--active\":\"#333333\",\"optimizedCheckout-formField-inputControlColor\":\"#476bef\",\"optimizedCheckout-contentPrimary-color\":\"#333333\",\"optimizedCheckout-buttonSecondary-font\":\"Google_Montserrat_400\",\"storeName-color\":\"#333333\",\"optimizedCheckout-backgroundImage\":\"\",\"form-label-font-color\":\"#555555\",\"color-greyLightest\":\"#e5e5e5\",\"optimizedCheckout-header-backgroundColor\":\"#f5f5f5\",\"productpage_related_products_count\":10,\"optimizedCheckout-buttonSecondary-backgroundColorActive\":\"#e5e5e5\",\"color-textLink\":\"#333333\",\"color-greyLighter\":\"#cccccc\",\"paymentbanners-homepage-ratio\":\"8x1\",\"color-secondaryDark\":\"#e5e5e5\",\"fontSize-h6\":14,\"paymentbuttons-paypal-fundingicons\":false,\"carousel-arrow-color\":\"#999999\",\"productpage_similar_by_views_count\":10,\"pdp-custom-fields-tab-label\":\"Additional Information\",\"afterpay-button-color\":\"black-mint\",\"optimizedCheckout-buttonPrimary-color\":\"#ffffff\",\"input-bg-color\":\"#ffffff\",\"loadingOverlay-backgroundColor\":\"#ffffff\",\"paymentbanners-proddetailspage-ratio\":\"8x1\",\"navPages-subMenu-separatorColor\":\"#cccccc\",\"navPages-color-hover\":\"#757575\",\"color-infoLight\":\"#d9dde0\",\"paymentbanners-homepage-color\":\"white\",\"googlepay-button-color\":\"black\",\"product_sale_badges\":\"none\",\"ItemSixImage\":\"\",\"default_image_product\":\"img/ProductDefault.gif\",\"navUser-dropdown-borderColor\":\"#cccccc\",\"optimizedCheckout-buttonPrimary-colorActive\":\"#ffffff\",\"color-greyMedium\":\"#757575\",\"optimizedCheckout-formChecklist-borderColor\":\"#cccccc\",\"fontSize-h1\":40,\"homepage_featured_products_count\":12,\"color-greyLight\":\"#999999\",\"paymentbuttons-paypal-accelerated-border-color\":\"black\",\"optimizedCheckout-logo\":\"\",\"icon-ratingEmpty\":\"#cccccc\",\"show_product_details_tabs\":true,\"icon-color\":\"#757575\",\"checkout-paymentbuttons-paypal-shape\":\"rect\",\"overlay-backgroundColor\":\"#333333\",\"input-border-color-active\":\"#999999\",\"hide_contact_us_page_heading\":false,\"container-fill-dark\":\"#e5e5e5\",\"product_sold_out_badges\":\"none\",\"homepage_show_carousel_play_pause_button\":true,\"optimizedCheckout-buttonPrimary-backgroundColorDisabled\":\"#cccccc\",\"button--primary-color\":\"#ffffff\",\"focusTooltip-backgroundColor\":\"#313440\",\"optimizedCheckout-buttonPrimary-borderColorHover\":\"transparent\",\"color-successLight\":\"#dbe1dc\",\"paymentbuttons-number-of-buttons\":1,\"color-greyDarker\":\"#333333\",\"show_product_quantity_box\":true,\"color-success\":\"#4c6a50\",\"zoom_size\":\"1280x1280\",\"color-white\":\"#ffffff\",\"color_hover_product_sold_out_badges\":\"#000000\",\"optimizedCheckout-buttonSecondary-backgroundColor\":\"#ffffff\",\"productview_thumb_size\":\"50x50\",\"fontSize-h3\":24,\"spinner-borderColor-light\":\"#ffffff\",\"geotrust_ssl_common_name\":\"\",\"optimizedCheckout-header-borderColor\":\"#888888\",\"paymentbuttons-container\":\"medium\",\"carousel-dot-color-active\":\"#757575\",\"input-border-color\":\"#888888\",\"optimizedCheckout-buttonPrimary-backgroundColor\":\"#333333\",\"color-secondary\":\"#ffffff\",\"carousel-play-pause-button-borderColor\":\"#ffffff\",\"carousel-bgColor\":\"#ffffff\",\"checkout-paymentbuttons-paypal-color\":\"black\",\"button--primary-backgroundColorActive\":\"#000000\",\"color-textSecondary--hover\":\"#333333\",\"color-whitesBase\":\"#e5e5e5\",\"ItemTwoImage\":\"\",\"body-bg\":\"#ffffff\",\"dropdown--quickSearch-backgroundColor\":\"#e5e5e5\",\"optimizedCheckout-contentSecondary-font\":\"Google_Montserrat_400\",\"navUser-dropdown-backgroundColor\":\"#ffffff\",\"color-primary\":\"#757575\",\"optimizedCheckout-contentPrimary-font\":\"Google_Montserrat_400\",\"supported_card_type_icons\":[\"american_express\",\"diners\",\"discover\",\"mastercard\",\"visa\"],\"ItemSevenImage\":\"\",\"navigation_design\":\"simple\",\"optimizedCheckout-formField-textColor\":\"#333333\",\"color-black\":\"#ffffff\",\"homepage_top_products_column_count\":4,\"hide_page_heading\":false,\"ItemFourImage\":\"\",\"focusTooltip-textColor\":\"#ffffff\",\"checkout-paymentbuttons-paypal-size\":\"large\",\"optimizedCheckout-buttonSecondary-colorHover\":\"#333333\",\"hide_breadcrumbs\":false,\"button--primary-colorActive\":\"#ffffff\",\"paymentbanners-cartpage-logo-position\":\"left\",\"homepage_stretch_carousel_images\":false,\"optimizedCheckout-contentSecondary-color\":\"#757575\",\"checkout-paymentbuttons-paypal-label\":\"pay\",\"applePay-button\":\"black\",\"thumb_size\":\"100x100\",\"card-title-color-hover\":\"#757575\",\"ItemNineImage\":\"\",\"optimizedCheckout-buttonPrimary-borderColor\":\"#333333\",\"navUser-indicator-backgroundColor\":\"#333333\",\"api_base_url\":\"https://dev-demdaco.stage-codal.net/index.php/api\",\"optimizedCheckout-buttonSecondary-borderColorActive\":\"#757575\",\"hide_blog_page_heading\":false,\"optimizedCheckout-header-textColor\":\"#555555\",\"hide_category_page_heading\":false,\"optimizedCheckout-show-backgroundImage\":false,\"color-primaryLight\":\"#999999\",\"banner--deafault-backgroundColor\":\"#707070\",\"show_accept_visa\":false,\"logo-position\":\"center\",\"show_product_reviews_tabs\":false,\"carousel-dot-bgColor\":\"#ffffff\",\"ItemEightImage\":\"\",\"optimizedCheckout-form-textColor\":\"#666666\",\"paymentbuttons-paypal-accelerated-checkout-color\":\"#444\",\"optimizedCheckout-buttonSecondary-color\":\"#333333\",\"geotrust_ssl_seal_size\":\"M\",\"button--icon-svg-color\":\"#757575\",\"alert-color-alt\":\"#ffffff\",\"color_text_product_sold_out_badges\":\"#ffffff\",\"button--default-colorHover\":\"#333333\",\"checkRadio-backgroundColor\":\"#ffffff\",\"optimizedCheckout-buttonPrimary-backgroundColorHover\":\"#666666\",\"carousel-play-pause-button-bgColor\":\"#ffffff\",\"input-disabled-bg\":\"#ffffff\",\"paymentbanners-cartpage-text-color\":\"black\",\"dropdown--wishList-backgroundColor\":\"#ffffff\",\"container-border-global-color-base\":\"#e5e5e5\",\"productthumb_size\":\"100x100\",\"button--primary-colorHover\":\"#ffffff\",\"color-error\":\"#9a3324\",\"homepage_blog_posts_count\":3,\"color-textSecondary\":\"#757575\",\"gallery_size\":\"300x300\"},\"genericError\":\"Oops! Something went wrong.\",\"maintenanceMode\":[],\"urls\":{\"home\":\"https://www.demdaco.com/\",\"account\":{\"index\":\"/account.php\",\"orders\":{\"all\":\"/account.php?action=order_status\",\"completed\":\"/account.php?action=view_orders\",\"save_new_return\":\"/account.php?action=save_new_return\"},\"update_action\":\"/account.php?action=update_account\",\"returns\":\"/account.php?action=view_returns\",\"addresses\":\"/account.php?action=address_book\",\"inbox\":\"/account.php?action=inbox\",\"send_message\":\"/account.php?action=send_message\",\"add_address\":\"/account.php?action=add_shipping_address\",\"wishlists\":{\"all\":\"/wishlist.php\",\"add\":\"/wishlist.php?action=addwishlist\",\"edit\":\"/wishlist.php?action=editwishlist\",\"delete\":\"/wishlist.php?action=deletewishlist\"},\"details\":\"/account.php?action=account_details\",\"recent_items\":\"/account.php?action=recent_items\",\"payment_methods\":{\"all\":\"/account.php?action=payment_methods\"}},\"brands\":\"https://www.demdaco.com/brands/\",\"gift_certificate\":{\"purchase\":\"/giftcertificates.php\",\"redeem\":\"/giftcertificates.php?action=redeem\",\"balance\":\"/giftcertificates.php?action=balance\"},\"auth\":{\"login\":\"/login.php\",\"check_login\":\"/login.php?action=check_login\",\"create_account\":\"/login.php?action=create_account\",\"save_new_account\":\"/login.php?action=save_new_account\",\"forgot_password\":\"/login.php?action=reset_password\",\"send_password_email\":\"/login.php?action=send_password_email\",\"save_new_password\":\"/login.php?action=save_new_password\",\"logout\":\"/login.php?action=logout\"},\"product\":{\"post_review\":\"/postreview.php\"},\"cart\":\"/cart.php\",\"checkout\":{\"single_address\":\"/checkout\",\"multiple_address\":\"/checkout.php?action=multiple\"},\"rss\":{\"products\":[]},\"contact_us_submit\":\"/pages.php?action=sendContactForm\",\"search\":\"/search.php\",\"compare\":\"/compare\",\"sitemap\":\"/sitemap.php\",\"subscribe\":{\"action\":\"/subscribe.php\"}},\"secureBaseUrl\":\"https://www.demdaco.com\",\"cartId\":null,\"template\":\"pages/errors/404\",\"validationDictionaryJSON\":\"{\\\"locale\\\":\\\"en\\\",\\\"locales\\\":{\\\"validation_messages.valid_email\\\":\\\"en\\\",\\\"validation_messages.password\\\":\\\"en\\\",\\\"validation_messages.password_match\\\":\\\"en\\\",\\\"validation_messages.invalid_password\\\":\\\"en\\\",\\\"validation_messages.field_not_blank\\\":\\\"en\\\",\\\"validation_messages.certificate_amount\\\":\\\"en\\\",\\\"validation_messages.certificate_amount_range\\\":\\\"en\\\",\\\"validation_messages.price_min_evaluation\\\":\\\"en\\\",\\\"validation_messages.price_max_evaluation\\\":\\\"en\\\",\\\"validation_messages.price_min_not_entered\\\":\\\"en\\\",\\\"validation_messages.price_max_not_entered\\\":\\\"en\\\",\\\"validation_messages.price_invalid_value\\\":\\\"en\\\",\\\"validation_messages.invalid_gift_certificate\\\":\\\"en\\\"},\\\"translations\\\":{\\\"validation_messages.valid_email\\\":\\\"You must enter a valid email.\\\",\\\"validation_messages.password\\\":\\\"You must enter a password.\\\",\\\"validation_messages.password_match\\\":\\\"Your passwords do not match.\\\",\\\"validation_messages.invalid_password\\\":\\\"Passwords must be at least 7 characters and contain both alphabetic and numeric characters.\\\",\\\"validation_messages.field_not_blank\\\":\\\" field cannot be blank.\\\",\\\"validation_messages.certificate_amount\\\":\\\"You must enter a gift certificate amount.\\\",\\\"validation_messages.certificate_amount_range\\\":\\\"You must enter a certificate amount between [MIN] and [MAX]\\\",\\\"validation_messages.price_min_evaluation\\\":\\\"Min. price must be less than max. price.\\\",\\\"validation_messages.price_max_evaluation\\\":\\\"Min. price must be less than max. price.\\\",\\\"validation_messages.price_min_not_entered\\\":\\\"Min. price is required.\\\",\\\"validation_messages.price_max_not_entered\\\":\\\"Max. price is required.\\\",\\\"validation_messages.price_invalid_value\\\":\\\"Input must be greater than 0.\\\",\\\"validation_messages.invalid_gift_certificate\\\":\\\"Please enter your valid certificate code.\\\"}}\",\"validationFallbackDictionaryJSON\":\"{\\\"locale\\\":\\\"en\\\",\\\"locales\\\":{\\\"validation_fallback_messages.valid_email\\\":\\\"en\\\",\\\"validation_fallback_messages.password\\\":\\\"en\\\",\\\"validation_fallback_messages.password_match\\\":\\\"en\\\",\\\"validation_fallback_messages.invalid_password\\\":\\\"en\\\",\\\"validation_fallback_messages.field_not_blank\\\":\\\"en\\\",\\\"validation_fallback_messages.certificate_amount\\\":\\\"en\\\",\\\"validation_fallback_messages.certificate_amount_range\\\":\\\"en\\\",\\\"validation_fallback_messages.price_min_evaluation\\\":\\\"en\\\",\\\"validation_fallback_messages.price_max_evaluation\\\":\\\"en\\\",\\\"validation_fallback_messages.price_min_not_entered\\\":\\\"en\\\",\\\"validation_fallback_messages.price_max_not_entered\\\":\\\"en\\\",\\\"validation_fallback_messages.price_invalid_value\\\":\\\"en\\\",\\\"validation_fallback_messages.invalid_gift_certificate\\\":\\\"en\\\"},\\\"translations\\\":{\\\"validation_fallback_messages.valid_email\\\":\\\"You must enter a valid email.\\\",\\\"validation_fallback_messages.password\\\":\\\"You must enter a password.\\\",\\\"validation_fallback_messages.password_match\\\":\\\"Your passwords do not match.\\\",\\\"validation_fallback_messages.invalid_password\\\":\\\"Passwords must be at least 7 characters and contain both alphabetic and numeric characters.\\\",\\\"validation_fallback_messages.field_not_blank\\\":\\\" field cannot be blank.\\\",\\\"validation_fallback_messages.certificate_amount\\\":\\\"You must enter a gift certificate amount.\\\",\\\"validation_fallback_messages.certificate_amount_range\\\":\\\"You must enter a certificate amount between [MIN] and [MAX]\\\",\\\"validation_fallback_messages.price_min_evaluation\\\":\\\"Min. price must be less than max. price.\\\",\\\"validation_fallback_messages.price_max_evaluation\\\":\\\"Min. price must be less than max. price.\\\",\\\"validation_fallback_messages.price_min_not_entered\\\":\\\"Min. price is required.\\\",\\\"validation_fallback_messages.price_max_not_entered\\\":\\\"Max. price is required.\\\",\\\"validation_fallback_messages.price_invalid_value\\\":\\\"Input must be greater than 0.\\\",\\\"validation_fallback_messages.invalid_gift_certificate\\\":\\\"Please enter your valid certificate code.\\\"}}\",\"validationDefaultDictionaryJSON\":\"{\\\"locale\\\":\\\"en\\\",\\\"locales\\\":{\\\"validation_default_messages.valid_email\\\":\\\"en\\\",\\\"validation_default_messages.password\\\":\\\"en\\\",\\\"validation_default_messages.password_match\\\":\\\"en\\\",\\\"validation_default_messages.invalid_password\\\":\\\"en\\\",\\\"validation_default_messages.field_not_blank\\\":\\\"en\\\",\\\"validation_default_messages.certificate_amount\\\":\\\"en\\\",\\\"validation_default_messages.certificate_amount_range\\\":\\\"en\\\",\\\"validation_default_messages.price_min_evaluation\\\":\\\"en\\\",\\\"validation_default_messages.price_max_evaluation\\\":\\\"en\\\",\\\"validation_default_messages.price_min_not_entered\\\":\\\"en\\\",\\\"validation_default_messages.price_max_not_entered\\\":\\\"en\\\",\\\"validation_default_messages.price_invalid_value\\\":\\\"en\\\",\\\"validation_default_messages.invalid_gift_certificate\\\":\\\"en\\\"},\\\"translations\\\":{\\\"validation_default_messages.valid_email\\\":\\\"You must enter a valid email.\\\",\\\"validation_default_messages.password\\\":\\\"You must enter a password.\\\",\\\"validation_default_messages.password_match\\\":\\\"Your passwords do not match.\\\",\\\"validation_default_messages.invalid_password\\\":\\\"Passwords must be at least 7 characters and contain both alphabetic and numeric characters.\\\",\\\"validation_default_messages.field_not_blank\\\":\\\"The field cannot be blank.\\\",\\\"validation_default_messages.certificate_amount\\\":\\\"You must enter a gift certificate amount.\\\",\\\"validation_default_messages.certificate_amount_range\\\":\\\"You must enter a certificate amount between [MIN] and [MAX]\\\",\\\"validation_default_messages.price_min_evaluation\\\":\\\"Min. price must be less than max. price.\\\",\\\"validation_default_messages.price_max_evaluation\\\":\\\"Min. price must be less than max. price.\\\",\\\"validation_default_messages.price_min_not_entered\\\":\\\"Min. price is required.\\\",\\\"validation_default_messages.price_max_not_entered\\\":\\\"Max. price is required.\\\",\\\"validation_default_messages.price_invalid_value\\\":\\\"Input must be greater than 0.\\\",\\\"validation_default_messages.invalid_gift_certificate\\\":\\\"Please enter your valid certificate code.\\\"}}\",\"carouselArrowAndDotAriaLabel\":\"Go to slide [SLIDE_NUMBER] of [SLIDES_QUANTITY]\",\"carouselActiveDotAriaLabel\":\"active\",\"carouselContentAnnounceMessage\":\"You are currently on slide [SLIDE_NUMBER] of [SLIDES_QUANTITY]\"}").load(); </script> <script type="text/javascript" src="https://cdn11.bigcommerce.com/shared/js/csrf-protection-header-5eeddd5de78d98d146ef4fd71b2aedce4161903e.js"></script> <script type="text/javascript" src="https://cdn11.bigcommerce.com/r-fb9fc0bde19319629c907f9e67c06c746c46672c/javascript/visitor_stencil.js"></script> <script src='https://bigcommerce.route.com/checkout/listener.js?s=kmr73o5t54' ></script><script src='https://bigcommerce.route.com/checkout/routeimg.js' defer></script> <script> $(document).ready(function(){ $(".toolHover").mouseover(function(){ $(this).removeClass("toolHovered"); $(this).addClass("toolHovered"); }); $(".toolHover").mouseleave(function(){ $(this).removeClass("toolHovered"); }); $(".toolHover").focus(function(){ $(this).addClass("toolHovered"); }); $(".toolHover").keydown(function(ev){ if (ev.which ==27) { if ($(".toolHover").hasClass("toolHovered","true")) $(this).removeClass("toolHovered"); else { $(this).addClass("toolHovered") } } $(this).removeClass("toolHovered"); }); $('#form-action-addToCart').click(function(){ setTimeout(function() { $('#previewModal').focus() }, 1000); document.body.classList.add('user-is-tabbing'); }); $("iframe[data-src*='youtube']").attr('title', 'Youtube Video'); $('img').each(function() { if (!$(this).attr('alt')) // check if current image tag has alt attribute $(this).attr('alt', ''); // if it doesn't add 'null' alt attribute }); if( $('#facetedSearch-navList').length ) { $("#facetedSearch-navList").removeAttr('aria-hidden'); } if( $('.card-body .yotpo.bottomLine.yotpo-small a.text-m').length ) { $(".card-body .yotpo.bottomLine.yotpo-small a.text-m").remove(); } $('.card-body .yotpo.bottomLine.yotpo-small a.text-m').attr({ tabindex: "0", role: "link" }); //Place All Scripts above this line }); </script> <script> function handleFirstTab(e) { if (e.keyCode === 9) { document.body.classList.add('user-is-tabbing'); window.removeEventListener('keydown', handleFirstTab); window.addEventListener('mousedown', handleMouseDownOnce); } } function handleMouseDownOnce() { document.body.classList.remove('user-is-tabbing'); window.removeEventListener('mousedown', handleMouseDownOnce); window.addEventListener('keydown', handleFirstTab); } window.addEventListener('keydown', handleFirstTab); </script> <script> $( document ).ready(function() { $('body.user-is-tabbing input#search_query').focusout(function() { $('div[data-findify-autocomplete-wrapper]').hide(); }); $('body.user-is-tabbing input#search_query').focus(function() { $('div[data-findify-autocomplete-wrapper]').show(); }); }); $(window).on('load', function(){ $('.card-body .yotpo.bottomLine.yotpo-small a.text-m').attr({ tabindex: "0", role: "link" }); }); </script> <script> jQuery(document).ready(function ($) { setInterval(function () { if ($('a.control_slide1').hasClass('active')) { moveRight(); $('a.control_slide1').removeClass('active') $('a.control_slide2').addClass('active') } else if ($('a.control_slide2').hasClass('active')) { moveRight(); $('a.control_slide2').removeClass('active') $('a.control_slide3').addClass('active') } else if ($('a.control_slide3').hasClass('active')) { moveRight(); $('a.control_slide3').removeClass('active') $('a.control_slide1').addClass('active') } else { } }, 9000); var slideCount = $('#slider ul li').length; var slideWidth = $('#slider ul li').width(); var slideHeight = $('#slider ul li').height(); var sliderUlWidth = slideCount * slideWidth; $('#slider').css({ width: slideWidth, height: slideHeight }); $('#slider ul').css({ width: sliderUlWidth, marginLeft: - slideWidth }); $('#slider ul img').css({ width: sliderUlWidth }); $('#slider ul li:last-child').prependTo('#slider ul'); function moveLeft() { $('#slider ul').animate({ left: + slideWidth }, 1000, function () { $('#slider ul li:last-child').prependTo('#slider ul'); $('#slider ul').css('left', ''); }); }; function moveRight() { $('#slider ul').animate({ left: - slideWidth }, 1000, function () { $('#slider ul li:first-child').appendTo('#slider ul'); $('#slider ul').css('left', ''); }); }; $('a.control_slide1').addClass('active') $('a.control_slide1').click(function () { if ($('a.control_slide2').hasClass('active')) { moveLeft(); $('a.control_slide2').removeClass('active') $('a.control_slide1').addClass('active') } else if ($('a.control_slide3').hasClass('active')) { moveLeft(); moveLeft(); $('a.control_slide3').removeClass('active') $('a.control_slide1').addClass('active') } else { } }); $('a.control_slide2').click(function () { if ($('a.control_slide1').hasClass('active')) { moveRight(); $('a.control_slide1').removeClass('active') $('a.control_slide2').addClass('active') } else if ($('a.control_slide3').hasClass('active')) { moveLeft(); $('a.control_slide3').removeClass('active') $('a.control_slide2').addClass('active') } else { } }); $('a.control_slide3').click(function () { if ($('a.control_slide2').hasClass('active')) { moveRight(); $('a.control_slide2').removeClass('active') $('a.control_slide3').addClass('active') } else if ($('a.control_slide1').hasClass('active')) { moveRight(); moveRight(); $('a.control_slide1').removeClass('active') $('a.control_slide3').addClass('active') } else { } }); $('a.control_prev').click(function () { moveLeft(); }); $('a.control_next').click(function () { moveRight(); }); if(document.getElementById("ProductDescription")) document.getElementById("ProductDescription").innerHTML = document.getElementById("ProductDescription").innerHTML.replace("(TM)", "™"); if(document.getElementById("ProductName")) document.getElementById("ProductName").innerHTML = document.getElementById("ProductName").innerHTML.replace("(TM)", "™"); if(document.querySelector('#slider')){ document.querySelector('#slider').style.height = document.querySelectorAll('#slider li')[0].offsetHeight + "px"; } }); </script><script> /* if (document.querySelectorAll('.category-banner-bottom').length > 0 && document.querySelectorAll('.category-banner-bottom')[0].offsetHeight > 200){ document.querySelectorAll('.category-banner-bottom .banners')[0].style.height = "200px" document.querySelectorAll('.category-banner-bottom .banners')[0].style.overflow = "hidden" document.querySelectorAll('.category-banner-bottom')[0].insertAdjacentHTML('beforeend' ,'<a onclick="seeMore()" id="seeMore" class="gray-button">See More</a>') document.querySelectorAll('.category-banner-bottom .banners')[0].insertAdjacentHTML('afterend' ,'<div id="fade" style="top: 0px;width: 100%;position: relative;margin-top: 115px;height: 85px;background-image: linear-gradient(rgba(0,0,0,0), rgba(255,255,255,1));"> </div>') document.querySelectorAll('.category-banner-bottom')[0].insertAdjacentHTML('beforeend' ,'<a onclick="seeLess()" id="seeLess" class="gray-button" >See Less</a>') document.querySelector('#seeLess').style.display = "none" } else{ }*/ function seeMore() { document.querySelectorAll('.category-banner-bottom .banners')[0].style.height = "unset" document.querySelectorAll('.category-banner-bottom .banners')[0].style.overflow = "unset" document.querySelector('#fade').style.display = "none" document.querySelector('#seeMore').style.display = "none" document.querySelector('#seeLess').style.display = "inline-block" } function seeLess() { document.querySelectorAll('.category-banner-bottom .banners')[0].style.height = "200px" document.querySelectorAll('.category-banner-bottom .banners')[0].style.overflow = "hidden" document.querySelector('#fade').style.display = "block" document.querySelector('#seeMore').style.display = "inline-block" document.querySelector('#seeLess').style.display = "none" } </script> <script> $(document).ready(function() { // Quickview // $('.button.quickview').click(function() {ga('send', 'event', 'Quickview', 'Click Quickview');}); // // Cart Icon // $('.navUser-item--cart').click(function() {ga('send', 'event', 'CartIcon', 'Click CartIcon');}); // // Cart Icon AddtoCart // $('.previewCartAction-checkout a').click(function() {ga('send', 'event', 'CartIcon', 'Click Checkout-Icon');}); // // Cart Icon ViewCart // $('.previewCartAction-viewCart a').click(function() {ga('send', 'event', 'CartIcon', 'Click ViewCart-Icon');}); // // Cart AddtoCart Button // $('#form-action-addToCart').click(function() {ga('send', 'event', 'CartButton', 'Click AddtoCart');}); // if(document.querySelectorAll('.previewCartCheckout a').length > 0){ // // Cart View or edit your cart // document.querySelectorAll('.previewCartCheckout a')[0].addEventListener("click", function() { // ga('send', 'event', 'Quickview', 'Click EditCart-quickview'); // }); // // Cart Proceed to checkout // document.querySelectorAll('.previewCartCheckout a')[2].addEventListener("click", function() { // ga('send', 'event', 'Quickview', 'Click Checkout-quickview'); // }); // } // // Cart Coupon // $('.cart-total-value').click(function() {ga('send', 'event', 'CartCoupon', 'Click AddCoupon');}); // // Cart redeemable-collapsable // $('.redeemable-collapsable').click(function() {ga('send', 'event', 'CheckoutCoupon', 'Click CheckoutAddCoupon');}); // // Checkout Complete // $('#checkout-payment-continue').click(function() {ga('send', 'event', 'Checkout', 'CheckoutCompleted');}); }); </script><script> var current_url = window.location.href; // if user is logout remove loged in flag if(current_url.indexOf('logout') > -1){ localStorage.removeItem("login_flag"); } // Login Flag var login_flag = localStorage.getItem("login_flag"); console.log('login_flag' + login_flag); console.log('window.customerid' + window.customerid); // if both the flag is 0 and the customer id doesn't exist if(login_flag == 0 && window.customerid != ""){ console.log('double email'); // ScarabQueue.push(['setEmail', window.customeremail]); // ScarabQueue.push(['setEmail', window.customeremail]); console.log('set login flag 1'); localStorage.setItem("login_flag", "1"); } var Scarab_productid = ''; var Scarab_categoryname = ''; // IF customer id is not empty send the data to emarsys if (window.customerid != ""){ // ScarabQueue.push(['setEmail', window.customeremail]); // ScarabQueue.push(['setEmail', window.customeremail]); } // Get the data of the cart and assign it to data $.get("https://" + window.location.hostname + "/api/storefront/cart", function( data ) { var itemsp = []; if(data.length > 0 && data[0].lineItems.physicalItems.length > 0){ // for debugging console.log('cart call'); console.log(data[0].lineItems); var items_list = data[0].lineItems.physicalItems; $.each(items_list, function(key,val) { var temp = {}; temp.item = val.sku; temp.price = val.salePrice; temp.quantity = val.quantity; itemsp.push(temp); }); } setTimeout(function(){ var Scarab_searchchar = $('[name=search_query]').val(); ScarabQueue.push(['cart', itemsp]); if(Scarab_productid != ""){ ScarabQueue.push(['view', Scarab_productid]); } if(Scarab_categoryname != ""){ var fullpath = ""; var length = $("ul.breadcrumbs li span").length - 1; console.log("Breadcrumb" + length) $("ul.breadcrumbs li span").each(function(index ) { if(index > 0){ fullpath += $(this).text(); } // checks for the length and if its great then 4 add the > // checks for the length and if its great then or equal to 3 add the > if(index < 4){ fullpath += " > "; } else if(index <= 3){ fullpath += " > "; } else {} }); console.log("Breadcrumb" + fullpath) ScarabQueue.push(['category', fullpath]); } if(Scarab_searchchar != ""){ ScarabQueue.push(['searchTerm', Scarab_searchchar]); } ScarabQueue.push(['go']); console.log('ScarabQueue called'); },3000); }); </script> <script language="javascript"> function onbeforesubmit() { return true; } </script> <script language="javascript"> var error; var form_lanuage = 'en'; function is_0_valid(){ count = 0; if(document.ProfileForm.optin){ if(document.ProfileForm.optin.checked){ if(document.getElementsByName('interest[]')){ if(document.getElementsByName('interest[]').length > 0 ){ Interest = document.getElementsByName('interest[]'); for(i = 0 ; i < Interest.length;i++){ if(Interest[i].checked) ++count; } if(count == 0){ error += "Interests:"; return false; } } } } } return true; } function is_3_valid(input) { if(input == "") { error += "Email: missing email\n"; return false; } var emailPat=/^(.+)@(.+)$/ var specialChars="\\(\\)<>@,;:\\\\\\\"\\.\\[\\]" var validChars="\[^\\s" + specialChars + "\]" var quotedUser="(\"[^\"]*\")" var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/ var atom=validChars + '+' var word="(" + atom + "|" + quotedUser + ")" var userPat=new RegExp("^" + word + "(\\." + word + ")*$") var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$") var matchArray=input.match(emailPat) if (matchArray==null) { error += "E-Mail: Please enter a valid e-mail address.\n"; // check @ and . return false } var user=matchArray[1] var domain=matchArray[2] if (user.match(userPat)==null) { error += "E-Mail: Please enter a valid e-mail address.\n"; // username doesn't seem to be valid return false } var IPArray=domain.match(ipDomainPat) if (IPArray!=null) { for (var i=1;i<=4;i++) { if (IPArray[i]>255) { error += "E-Mail: Please enter a valid e-mail address!\n"; // Destination IP address is invalid return false } } return true } var domainArray=domain.match(domainPat) if (domainArray==null) { error += "E-Mail: Please enter a valid e-mail address!\n"; // The domain name doesn't seem to be valid return false } var atomPat=new RegExp(atom,"g") var domArr=domain.match(atomPat) var len=domArr.length if (len<2) { error += "E-Mail: Please enter a valid e-mail address.\n"; // This address is missing a hostname return false } return true; } function CheckInputs(){ var check_ok = true; error = "Wrong input\n"; // is_0_valid is not needed since we will always have this true for anyone signing up. //check_ok = (is_0_valid('null') && check_ok); check_ok = (is_3_valid(document.querySelectorAll('[name=inp_3]')[1].value)); if(check_ok == false) alert(error); return check_ok; } // Have to make a seprate fuction for the footer and May need to do this again IF there are more then two forms on a page. // Reason for that mention is since there is a seprate Function for footer everything else or new forms should be able to use the default for checker function CheckInputsFooter(){ var check_ok = true; error = "Wrong input\n"; // is_0_valid is not needed since we will always have this true for anyone signing up. //check_ok = (is_0_valid('null') && check_ok); check_ok = (is_3_valid(document.querySelector('#SubmitFooter').value)); if(check_ok == false) alert(error); return check_ok; } </script> <script language="javascript"> function SubmitIt(){ if(CheckInputs() == true){ if(window.onbeforesubmit) onbeforesubmit(); document.querySelectorAll('[name=ProfileForm]')[0].submit(); } } // Have to make a seprate fuction for the footer and May need todo this again IF there are more then two forms on a page. // Reason for that mention is since there is a seprate Function for footer everything else or new forms should be able to use the default for checker function SubmitItFooter(){ if(CheckInputsFooter() == true){ if(window.onbeforesubmit) onbeforesubmit(); //[name=ProfileForm] document.querySelectorAll('[name=ProfileFormFooter]')[0].submit(); } } function FieldWithName(frm, fieldname, numofield) { if(!numofield) numofield = 0; field_count = 0; for(i = 0; i < frm.elements.length; ++i) { if(frm.elements[i].name == fieldname) { if(field_count == numofield) return frm.elements[i]; else field_count++; } } } function NumChecked(frm, fieldname) { var count = 0; for(i = 0; i < frm.elements.length; ++i) { if(frm.elements[i].name == fieldname && frm.elements[i].checked == true) ++count; } return count; } function NumSel(field) { var count = 0; for(i = 0; i < field.length; ++i) if(field[i].selected == true) ++count; return count; } </script> <script language="javascript"> var multiFields = new Array(); var dateFields = new Array(); multiFields["interest[]"] = "interest" multiFields["optin"] = "optin" var arr_optin = new Array(); arr_optin["True"] = "y"; var arr_interest = new Array(); </script> <script> function shopLocal(){ if (document.querySelector('#stickyTopButton') == undefined){ document.querySelectorAll('.head-right')[0].insertAdjacentHTML('beforeBegin', ` <div id="stickyTopButton"><a href="https://www.demdaco.com/store-locator/" target="_blank"> <p style="color: white;/* float: left; */margin: 5px auto;/* text-align: center; */font-weight: bold;font-size: 18px;line-height: 18px;width: 223px;display: block;"> <img style="float: left;width: 43px;height: auto;margin: 0px 14px 0px 0px;" src="https://store-kmr73o5t54.mybigcommerce.com/content/icons/shop-local-icon.png" alt=""> SHOP LOCAL<br> <em style="font-size: 14px;">Find a retailer near you</em></p></a> <style> #stickyTopButton { background-color: #b10d28; height: 50px; margin: 0px; width: 100vw; position: absolute; left: 0px; right: 0px; top: 80px; z-index: -1; } </style> </div> `) }else{ } } if (window.location.href == 'https://www.demdaco.com/giving-collection/') { if(window.innerWidth < 600){ shopLocal() document.querySelector('#stickyButton').style.display = "none" } else{} window.addEventListener('resize', function(event) { if(window.innerWidth < 600){ shopLocal() document.querySelector('#stickyButton').style.display = "none" } else if(window.innerWidth > 600){ try{document.querySelector('#stickyTopButton').remove()} catch(err){} document.querySelector('#stickyButton').style.display = "block" } }, true); }else{false} </script> <script> function noticeShipping(){ try {document.querySelector('#shippingNotice').remove() } catch (error) { } document.querySelector('#calc_results').insertAdjacentHTML('afterEnd', ` <div id="shippingNotice" class="alertBox alertBox--info"> <div id="toolTipExplain" style="position: absolute; background-color: white; color: #555555; font-size: 16px; padding: 20px; border-radius: 5px; border: solid 2px #888888; z-index: 999; top: -180px; display: block; left: 0px; display: none;"> Please note that every order has a one business day processing requirement. If you select FedEx Overnight shipping, your package will not arrive until two business days from the order date. To receive your package in this timeframe, you must place your order by 10 a.m. Central Standard Time. PO boxes are not eligible for 2 Day or Overnight shipping. </div> <div class="alertBox-column alertBox-icon"> <icon glyph="ic-success" class="icon" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"></path></svg></icon> </div> <p class="alertBox-column alertBox-message"> <span><a href="/shipping-returns/" target="_blank" style=" font-weight: bold; font-size: 16px;" >Every order has a one business day <br> processing requirement</a></span> </p> </div> <style> </style> `) } if(document.querySelectorAll('.ship_calc_submit').length > 0){ document.querySelectorAll('.ship_calc_submit')[0].addEventListener('keyup',function(e){ if (e.keyCode === 13 || event.code === 'Enter') { noticeShipping() console.log('true') document.querySelector('#shippingNotice').addEventListener('mouseover',function(){ document.querySelector('#toolTipExplain').style.display = "block" }); document.querySelector('#shippingNotice').addEventListener('mouseout',function(){ document.querySelector('#toolTipExplain').style.display = "none" }); } }); } if(document.querySelectorAll('.ship_calc_submit').length > 0){ document.querySelectorAll('.ship_calc_submit')[0].addEventListener("click", function() { noticeShipping() console.log('true') document.querySelector('#shippingNotice').addEventListener('mouseover',function(){ document.querySelector('#toolTipExplain').style.display = "block" }); document.querySelector('#shippingNotice').addEventListener('mouseout',function(){ document.querySelector('#toolTipExplain').style.display = "none" }); }); } </script> <script language="javascript"> if(typeof SubmitIt != "function"){ var error; var form_lanuage = 'en'; function is_0_valid(){ count = 0; if(document.ProfileForm.optin){ if(document.ProfileForm.optin.checked){ if(document.getElementsByName('interest[]')){ if(document.getElementsByName('interest[]').length > 0 ){ Interest = document.getElementsByName('interest[]'); for(i = 0 ; i < Interest.length;i++){ if(Interest[i].checked) ++count; } if(count == 0){ error += "Interests:"; return false; } } } } } return true; } function is_3_valid(input) { if(input == "") { error += "Email: missing data!\n"; return false; } var emailPat=/^(.+)@(.+)$/ var specialChars="\\(\\)<>@,;:\\\\\\\"\\.\\[\\]" var validChars="\[^\\s" + specialChars + "\]" var quotedUser="(\"[^\"]*\")" var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/ var atom=validChars + '+' var word="(" + atom + "|" + quotedUser + ")" var userPat=new RegExp("^" + word + "(\\." + word + ")*$") var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$") var matchArray=input.match(emailPat) if (matchArray==null) { error += "E-Mail: Please enter a valid e-mail address!\n"; // check @ and . return false } var user=matchArray[1] var domain=matchArray[2] if (user.match(userPat)==null) { error += "E-Mail: Please enter a valid e-mail address!\n"; // username doesn't seem to be valid return false } var IPArray=domain.match(ipDomainPat) if (IPArray!=null) { for (var i=1;i<=4;i++) { if (IPArray[i]>255) { error += "E-Mail: Please enter a valid e-mail address!\n"; // Destination IP address is invalid return false } } return true } var domainArray=domain.match(domainPat) if (domainArray==null) { error += "E-Mail: Please enter a valid e-mail address!\n"; // The domain name doesn't seem to be valid return false } var atomPat=new RegExp(atom,"g") var domArr=domain.match(atomPat) var len=domArr.length if (len<2) { error += "E-Mail: Please enter a valid e-mail address!\n"; // This address is missing a hostname return false } return true; } function CheckInputs() { var check_ok = true; error = "Wrong input!\n"; check_ok = (is_0_valid('null') && check_ok); check_ok = (is_3_valid(document.ProfileForm.inp_3.value) && check_ok); if(check_ok == false) alert(error); return check_ok; } function SubmitIt(){ if(CheckInputs() == true){ if(window.onbeforesubmit) onbeforesubmit(); document.ProfileForm.submit(); } } function MailIt(){ if(CheckInputs()){ if((document.ProfileForm.subject.value=='') || (document.ProfileForm.msg.value=='')) alert('Bitte f\u00fcr Sie die Nachrichtenfelder aus!'); else document.ProfileForm.submit(); } } function FieldWithName(frm, fieldname, numofield) { if(!numofield) numofield = 0; field_count = 0; for(i = 0; i < frm.elements.length; ++i) { if(frm.elements[i].name == fieldname) { if(field_count == numofield) return frm.elements[i]; else field_count++; } } } function NumChecked(frm, fieldname) { var count = 0; for(i = 0; i < frm.elements.length; ++i) { if(frm.elements[i].name == fieldname && frm.elements[i].checked == true) ++count; } return count; } function NumSel(field) { var count = 0; for(i = 0; i < field.length; ++i) if(field[i].selected == true) ++count; return count; } var multiFields = new Array(); var dateFields = new Array(); multiFields["interest[]"] = "interest" multiFields["optin"] = "optin" var arr_optin = new Array(); arr_optin["True"] = "y"; var arr_interest = new Array(); } </script> <script> $( document ).ready(function() { setTimeout(function(){ $( document ).ready(function() { document.querySelectorAll(".navPages a.navPages-action").forEach(function(tag){ if(tag.getAttribute('href') != 'javascript:void(0);'){ tag.setAttribute("href", tag.getAttribute('href') + "?_bc_fsnf=1&in_stock=1" ) } }) }); }, 1000); var loggedInicon = document.querySelector('.loggedin-icon') var accountDropdown = document.querySelector('.account-dropdown') try{ loggedInicon.addEventListener("mouseover", function(){ accountDropdown.style.display = "block" }) accountDropdown.addEventListener("mouseout", function(){ accountDropdown.style.display = "none" }) }catch{} function NavMenu(){ var SubParentDrop = document.querySelectorAll('.navMegaBar .navPage-subMenu-item') SubParentDrop.forEach(SubParentDropTest => { try{ if(SubParentDropTest.children[1]){ SubParentDropTest.children[1].style.display = "none"; SubParentDropTest.children[0].classList.remove('is-open') document.querySelector('.SubBackButton').remove() } }catch{ } }) var parentDrop = document.querySelectorAll('.navMegaBar .navPages-list .navPages-item') parentDrop.forEach(parentDropTest => { try{ if(parentDropTest.children[1]){ parentDropTest.children[1].style.display = "none"; parentDropTest.children[0].classList.remove('is-open') document.querySelector('.backButton').remove() } }catch{ } }); } function toggleMenu(){ if(document.querySelector('.mobileMenu-toggle').classList.contains('is-open') == true){ document.querySelector('.mobileMenu-toggle').classList.remove('is-open') document.querySelector('.navMegaBar').style.display = "none" } else{ document.querySelector('.mobileMenu-toggle').classList.add('is-open'); document.querySelector('.navMegaBar').style.display = "block" } } const mediaQuery = window.matchMedia('(max-width: 1279px)') if (mediaQuery.matches) { document.querySelectorAll('.navUser-item--cart').forEach(cart => { cart.addEventListener('click', function(){ window.location.href = "/cart.php"; }) }); document.querySelectorAll('.profileLog').forEach(profile => { profile.addEventListener('click', function(){ window.location.href = "/account.php"; }) }); var parentDrop = document.querySelectorAll('.navMegaBar .navPages-list .navPages-item') parentDrop.forEach(parentDropTest => { // console.log(parentDropTest); parentDropTest.children[0].addEventListener('click', function() { if(parentDropTest.children[1]){ if(parentDropTest.children[1].style.display === "block"){ parentDropTest.children[1].style.display = "none"; parentDropTest.children[0].classList.remove('is-open') } else{ parentDropTest.children[1].style.display = "block"; parentDropTest.children[1].classList.remove('is-open') // document.querySelectorAll('.navMegaBar .navPages-list .navPages-item').children[1].children[1].children[1].children[0].classList.remove('is-open') } parentDropTest.children[1].insertAdjacentHTML('afterbegin', '<div class="backButton"><i aria-hidden="true" style="padding: 0px;" class="icon navPages-action-moreIcon"><svg><use xlink:href="#icon-chevron-down"></use></svg></i> <p>Back</p></div>') backButtonNav() } }) }); function backButtonNav(){ document.querySelector('.backButton').addEventListener('click', function() { document.querySelector('.backButton').parentElement.style.display = "none" document.querySelector('.backButton').remove() }) } var SubParentDrop = document.querySelectorAll('.navMegaBar .navPage-subMenu-item') SubParentDrop.forEach(SubParentDropTest => { // console.log(SubParentDropTest); SubParentDropTest.children[0].addEventListener('click', function() { try{ if(SubParentDropTest.children[1]){ if(SubParentDropTest.children[1].style.display === "block"){ SubParentDropTest.children[1].style.display = "none"; SubParentDropTest.children[0].classList.remove('is-open') }else{ SubParentDropTest.children[1].style.display = "block"; SubParentDropTest.children[1].insertAdjacentHTML('afterbegin', '<div class="SubBackButton"> <i aria-hidden="true" style="padding: 0px;" class="icon navPages-action-moreIcon"><svg><use xlink:href="#icon-chevron-down"></use></svg></i> <p>Back</p></div>') SubParentDropTest.children[1].classList.remove('is-open') SubBackButtonNav() } } }catch{ } }) function SubBackButtonNav(){ document.querySelector('.SubBackButton').addEventListener('click', function() { document.querySelector('.SubBackButton').parentElement.style.display = "none" document.querySelector('.SubBackButton').remove() // is-open }) } // has-subMenu document.querySelectorAll('.has-subMenu').forEach(subaction => { subaction.href = 'javascript:void(0);'; }) }); }; setTimeout(function() { if(document.querySelector('.mobileMenu-toggleParentClick')){ document.querySelector('.mobileMenu-toggleParentClick').addEventListener('click', function() { toggleMenu(); try{ if(document.querySelector('.mobileMenu-toggle').classList.contains('is-open') == true){ NavMenu(); } else{ } }catch{} }) } }, 500); }); $('.navUser-item--cart').click(function(){ $("#cart-preview-dropdown").removeClass('d-none'); if (!$("#cart-preview-dropdown").hasClass('is-open')) { $("#cart-preview-dropdown").removeClass('d-none'); } else{ $("#cart-preview-dropdown").addClass('d-none'); } }); </script> <script> var featuredSectionNames = document.querySelectorAll('[data-name]'); var featuredSection = [ '', '', '', '', '', '', '', '', '' ] console.log(featuredSection) // console.log(featuredSectionNames) /* for(var i = 0; i < featuredSection.length ; i++){ document.querySelectorAll('[data-name]')[i].insertAdjacentHTML("afterbegin", ` <img src="${featuredSection[i]}" width="200px" height="auto" alt="" style="width: 100%; height: auto;"> `) } */ </script> <script> // this was added to all stores and will use themeseting or possibly widgets to do with in the future. since we are able to change where this script shows in theory we can make this show up differently for different people and on different kinds of pages var imageNavArr = [ { "ImageURL": "", "LinksTo": "/shop-by/gifts/gifts-to-lift-the-spirit/", "CustomClasses": "featuredNav1", "ButtonCopy": "Shop All", "ButtonStyle": "gray-button-outline", "Display": "none" }, { "ImageURL": "/content/featuredMenu/FeaturedHome%20and%20Living.jpg", "LinksTo": "/shop-by/home-living/", "CustomClasses": "featuredNav2", "ButtonCopy": "Shop All", "ButtonStyle": "gray-button-outline", "Display": "block" }, { "ImageURL": "/content/featuredMenu/Featuredmaril.jpg", "LinksTo": "/maril-fragrance/fragrances/", "CustomClasses": "featuredNav3", "ButtonCopy": "Shop All", "ButtonStyle": "gray-button-outline", "Display": "block" }, { "ImageURL": "/content/featuredMenu/FeaturedKitchen%20and%20Entertaining%20.jpg", "LinksTo": "/shop-by/kitchen-entertaining/", "CustomClasses": "featuredNav4", "ButtonCopy": "Shop All", "ButtonStyle": "gray-button-outline", "Display": "block" }, { "ImageURL": "/content/featuredMenu/FeaturedFashion.jpg", "LinksTo": "/shop-by/fashion/", "CustomClasses": "featuredNav5", "ButtonCopy": "Shop All", "ButtonStyle": "gray-button-outline", "Display": "block" }, { "ImageURL": "/content/featuredMenu/FeaturedBaby%20and%20Kids.jpg", "LinksTo": "/shop-by/baby-kids/", "CustomClasses": "featuredNav6", "ButtonCopy": "Shop All", "ButtonStyle": "gray-button-outline", "Display": "block" }, { "ImageURL": "/content/featuredMenu/FeaturedWillowTree.jpg", "LinksTo": "/shop-by/willow-tree/", "CustomClasses": "featuredNav7", "ButtonCopy": "Shop All", "ButtonStyle": "gray-button-outline", "Display": "block" },{ "ImageURL": "/content/featuredMenu/FeaturedGifts.jpg", "LinksTo": "/shop-by/gifts/", "CustomClasses": "featuredNav8", "ButtonCopy": "Shop All", "ButtonStyle": "gray-button-outline", "Display": "block" }, { "ImageURL": "/content/featuredMenu/FeaturedHolidays.jpg", "LinksTo": "/santas-kindness/", "CustomClasses": "featuredNav9", "ButtonCopy": "Shop Santa's kindness", "ButtonStyle": "gray-button-outline", "Display": "block" }]; var imageNavList = document.querySelectorAll('.imageNav') for(var i = 0; i < imageNavList.length; i++){ imageNavList[i].style.display = imageNavArr[i].Display; imageNavList[i].classList.add(imageNavArr[i].CustomClasses); imageNavList[i].insertAdjacentHTML("beforeend", `<a style="padding: unset !important; border: none; display: inline;" href="${imageNavArr[i].LinksTo}"><img src="${imageNavArr[i].ImageURL}" alt="" width="200px" height="auto" style="max-width: 300px; width:100%; height: auto;" class="lazyload"></a>`) imageNavList[i].insertAdjacentHTML("beforeend", ` <div style="background-color: #eee; width: 100%; max-width: 300px; text-align: center; padding: 20px 0px;"> <a class="${imageNavArr[i].ButtonStyle}" href="${imageNavArr[i].LinksTo}" style="padding: 5px 25px !important; border-bottom: solid 1px #555;"> ${imageNavArr[i].ButtonCopy} </a> </div> `); // console.log(imageNavList[i]) } </script> <script id="bloomreach-config" type="text/javascript"> window.bloomreachConnector = {}; bloomreachConnector.config = { account_id: "", domain_key: "", auth_key: "", tracking_cookie: "", default_search_parameter: "search_query", search_page_url: "", widget_endpoint: "https://pathways.dxpapi.com/api/v2/widgets/", widget_fields: "pid,price,sale_price,title,thumb_image,url", search: { enabled: false, fields: "pid,title,brand,price,sale_price,thumb_image,sku_thumb_images,sku_swatch_images,sku_color_group,url,price_range,sale_price_range,description", endpoint: "https://core.dxpapi.com/api/v1/core/", selector: ".main-content", template: "<% if (did_you_mean.length) { %> <div class=\"blm-product-search-header\"> <div class=\"blm-product-search-header-container\"> <h1 class=\"blm-product-search-header-container__title\">Results for <% if (locals.keywordRedirect && keywordRedirect.redirected_url) { %> <i><%- keywordRedirect.redirected_url %></i> <% } else { %> <i><%- did_you_mean[0] %></i> <% } %> instead of <i class=\"blm-product-search-header-container__title__searched-word\"><%- originalQuery %></i></h1> <div class=\"blm-did-you-mean-suggestion\"> <label class=\"blm-did-you-mean-suggestion__label\">Did you mean:</label> <% did_you_mean.forEach(function(word) { %> <a href=\"<%= config.get('searchPageUrl') %>?<%= config.get('defaultSearchParameter') %>=<%= word %>\" class=\"blm-did-you-mean-suggestion__link\"><%- word %></a> <% }); %> </div> <% if (locals.keywordRedirect && keywordRedirect.redirected_query) { %> <div class=\"blm-redirected-keyword\">Redirected from <i>\"<%- keywordRedirect.redirected_query %>\"</i>.</div> <% } %> </div> </div> <% } %> <% if (locals.keywordRedirect && keywordRedirect.redirected_url && did_you_mean.length === 0) { %> <div class=\"blm-product-search-header\"> <div class=\"blm-product-search-header-container\"> <h1 class=\"blm-product-search-header-container__title\">Results for <i><%- keywordRedirect.redirected_url %></i> </h1> <div class=\"blm-redirected-keyword\">Redirected from <i>\"<%- keywordRedirect.redirected_query %>\"</i> </div> </div> </div> <% } %> <div class=\"blm-product-search <% if (config.get('areFacetsIncluded')) { %>with-facets<% } %>\"> <% if (config.get('areFacetsIncluded') && facets.length) { %> <aside class=\"blm-product-search-sidebar\"> <button class=\"blm-product-search-control-button blm-product-search-control-button--sidebar\"> Filter <svg viewBox=\"0 0 14.8 14.8\" class=\"blm-product-search-control-button__icon\" focusable=\"false\"><path d=\"M1.6 14.8V0m6 14.8V1.6m5.6 13.2V0\" fill=\"none\" stroke=\"#000\" stroke-miterlimit=\"10\"></path><circle cx=\"1.6\" cy=\"7.4\" r=\"1.6\"></circle><circle cx=\"13.2\" cy=\"10.4\" r=\"1.6\"></circle><circle cx=\"7.6\" cy=\"1.6\" r=\"1.6\"></circle></svg> </button> <div class=\"blm-product-search-sidebar-content <% if (locals.isFiltersPanelOpened && isFiltersPanelOpened) { %>blm-open<% } %>\"> <button class=\"blm-product-search-control-button blm-product-search-control-button--sidebar blm-product-search-control-button--active\"> Done <svg viewBox=\"0 0 14.8 14.8\" class=\"blm-product-search-control-button__icon\" focusable=\"false\"><path class=\"blm-product-search-control-button__icon-path\" d=\"M1.6 14.8V0m6 14.8V1.6m5.6 13.2V0\" fill=\"none\" stroke=\"#000\" stroke-miterlimit=\"10\"></path><circle cx=\"1.6\" cy=\"7.4\" r=\"1.6\"></circle><circle cx=\"13.2\" cy=\"10.4\" r=\"1.6\"></circle><circle cx=\"7.6\" cy=\"1.6\" r=\"1.6\"></circle></svg> </button> <div class=\"blm-product-search-filter\"> <h4 class=\"blm-product-search-filter-title\">Price</h4> <div class=\"blm-price-range-container\"> <div class=\"blm-range-slider\"> <input value=\"<%= checkedFacets.price ? checkedFacets.price[0] : priceRangeFacet.start %>\" min=\"<%- priceRangeFacet.start %>\" max=\"<%- priceRangeFacet.end %>\" step=\"1\" type=\"range\" class=\"blm-price-range-input blm-price-range-input--lower blm-price-range-input--lower-%%-REQUEST_ID-%%\" > <span class=\"blm-price-range-slider-rail\"></span> <input value=\"<%= checkedFacets.price ? checkedFacets.price[1] : priceRangeFacet.end %>\" min=\"<%- priceRangeFacet.start %>\" max=\"<%- priceRangeFacet.end %>\" step=\"1\" type=\"range\" class=\"blm-price-range-input blm-price-range-input--upper blm-price-range-input--upper-%%-REQUEST_ID-%%\" > </div> <div class=\"blm-range-slider__values\"> <span class=\"blm-range-slider__values--min\"> <%= checkedFacets.price ? formatMoney(checkedFacets.price[0] * 100) : formatMoney(priceRangeFacet.start * 100) %> </span> <% if (checkedFacets.price) { %> <span class=\"blm-range-slider__values--max\"> <%= checkedFacets.price ? formatMoney(checkedFacets.price[1] * 100) : formatMoney(priceRangeFacet.start * 100) %> </span> <% } else { %> <span class=\"blm-range-slider__values--max\"> <%= formatMoney(priceRangeFacet.end * 100) %> </span> <% } %> </div> <% if (checkedFacets.price) { %> <div class=\"blm-range-slider__clear-values\"> <button class=\"blm-range-slider__clear-values-button blm-range-slider__clear-values-button--%%-REQUEST_ID-%%\">Clear</button> </div> <% } %> </div> </div> <% facets.forEach(function(facet, facetIndex) { %> <% if (facet.section.length > 0) { %> <div class=\"blm-product-search-filter\" id=\"blm-facet-block-item-<%= facetIndex %>\"> <h4 class=\"blm-product-search-filter-title\"><%- facet.title %></h4> <ul class=\"blm-product-search-filter-items\"> <% facet.section.forEach(function(item) { %> <li class=\"blm-product-search-filter-item\"> <input type=\"checkbox\" <% if (facet.original_title in checkedFacets && checkedFacets[facet.original_title].includes(escapeSpecialCharacters(item.id))) { %>checked<% } %> name=\"<%- facet.original_title %>\" value=\"<%- escapeSpecialCharacters(item.id) %>\" id=\"<%- facet.original_title + '[' + escapeSpecialCharacters(item.name) + ']' %>\" class=\"blm-product-search-filter-item__checkbox\" /> <label class=\"blm-product-search-filter-item__name\" for=\"<%- facet.original_title + '[' + escapeSpecialCharacters(item.name) + ']' %>\"><%- item.name %></label> <% if (!config.get('displayVariants')) { %> <span class=\"blm-product-search-filter-item__badge\"><%- item.count %></span> <% } %> </li> <% }); %> </ul> <% if (facet.section.length > config.get('initialNumberOfFacetValues')) { %> <div class=\"blm-product-search-load-more\" data-item=\"<%= facetIndex %>\">+ More</div> <% } %> </div> <% } %> <% }); %> <% if (facets[0].section.length) { %> <div class=\"blm-load-more-facet blm-load-more-facet--%%-REQUEST_ID-%%\">+ More </div> <% } %> </div> </aside> <% } %> <section class=\"blm-product-search-main\"> <div class=\"blm-product-search-toolbar\"> <% if (locals.number_of_results && number_of_results > 0) { %> <h2 class=\"blm-product-search-toolbar__title\"> Showing <%- start + 1 %> - <%- Math.min(start + products.length, number_of_results) %> of <%- number_of_results %> products </h2> <div class=\"blm-product-search-toolbar-options\"> <span class=\"blm-product-search-toolbar-options blm-product-search-toolbar-options--page-size\"> <label for=\"sort-size-%%-REQUEST_ID-%%\" class=\"blm-product-search-toolbar-options__label\">Size: </label> <select name=\"sort-size\" id=\"sort-size-%%-REQUEST_ID-%%\" class=\"blm-product-search-toolbar-options__select\" > <% for (let i = 16; i <= 48; i += 4) { %> <option value=\"<%- i %>\" <% if (locals.size && size === i) { %>selected<% } %>><%- i %></option> <% } %> </select> </span> <span class=\"blm-product-search-toolbar-options blm-product-search-toolbar-options--sort-by\"> <label for=\"sort-by-%%-REQUEST_ID-%%\" class=\"blm-product-search-toolbar-options__label\">Sort By: </label> <select name=\"sort-by\" id=\"sort-by-%%-REQUEST_ID-%%\" class=\"blm-product-search-toolbar-options__select\" > <% config.get('sortingOptions').forEach(function(option) { %> <option value=\"<%- option.value %>\" <% if (locals.sort && sort === option.value) { %>selected<% } %>><%- option.label %></option> <% }) %> </select> </span> </div> <% } else { %> <h2 class=\"blm-product-search-toolbar__title\"> No results found </h2> <% } %> </div> <% if (products.length) { %> <div class=\"blm-product-search__results\"> %%-PRODUCT_LIST_TEMPLATE-%% </div> <% } %> <% if (!locals.mobileView || !mobileView.matches) { %> <% if (!config.get('infiniteScroll') && paginationData.length > 0) { %> <div class=\"blm-product-search-pagination\"> <ul class=\"blm-product-search-pagination__pages blm-product-search-pagination__pages--%%-REQUEST_ID-%%\"> <% paginationData.forEach(paginationNode => { %> <li class=\"blm-product-search-pagination__page\"> <button <% if (paginationNode.disabled) { %>disabled<% } %> class=\"blm-product-search-pagination__page-link <% if (paginationNode.active) { %>blm-product-search-pagination__page-link--active<% } %>\" data-value=\"<%- paginationNode.value %>\" ><%- paginationNode.label ?? paginationNode.value %></button > </li> <% }) %> </ul> </div> <% } %> <% } %> </section> </div>", product_list_template: "<% products.forEach(function(product) { %> <div class=\"blm-product-search__result\" <% if (product.variant_name) { %>title=\"<%- product.variant_name %>\"<% } %>> <% const matchingVariant = !Array.isArray(product.variants) ? null : 'variant_index' in product ? product.variants[product.variant_index] : product.variants.find(variant => selectedColors.includes(variant.sku_color_group ? variant.sku_color_group.toLowerCase() : null)) %> <div class=\"blm-product-search-image-container\"> <% if (product.variants && product.variants.length > 1) { %> <% product.variants.forEach(function(variant, index) { %> <% const isActiveVariant = !('variant_index' in product) && !selectedColors.length ? index === 0 : 'variant_index' in product ? product.variant_index === index : matchingVariant == variant %> <div class=\"blm-product-search-swatch-image fade\" <% if (isActiveVariant) { %>style=\"display: block\"<% } %> > <img class=\"blm-product-search-image-container__image\" alt=\"title\" src=\"<%= variant.image %>\" /> </div> <% }); %> <% } else { %> <div class=\"blm-product-search-swatch-image fade\" style=\"display: block\" > <img class=\"blm-product-search-image-container__image\" alt=\"title\" src=\"<%= product.image %>\" /> </div> <% } %> </div> <div class=\"blm-product-search-details-container\"> <div class=\"blm-product-search-details-title-container\"> <a href=\"<%= product.link %>\" class=\"blm-product-search-details-container__title\" ><%- product.title %></a > </div> <p class=\"blm-product-search-details-container__price\"> <% if (product.final_price) { %> <%= formatMoney(product.final_price.toFixed() * 100) %> <% } %> <span <% if (product.final_price) { %>class=\"blm-product-search-details-container__price--strike-through\"<% } %>> <%= formatMoney(product.price.toFixed() * 100) %> </span> </p> </div> <% if (product.variants && product.variants.length > 1) { %> <ul class=\"blm-product-search-swatch-container\"> <% product.variants.slice(0, defaultMaxColorSwatches || 0).forEach(function(variant, index) { %> <% const isActiveVariant = !('variant_index' in product) && !selectedColors.length ? index === 0 : 'variant_index' in product ? product.variant_index === index : matchingVariant == variant %> <li class=\"blm-product-search-swatch-container__swatch <% if (isActiveVariant) { %>active<% } %>\" style=\"background-image: url('<%= variant.image %>')\" ></li> <% }); %> </ul> <% if (product.variants.length > defaultMaxColorSwatches || 0) { %> <small class=\"blm-product-search-swatch-colors\">(Colors) <%- product.variants.length %></small> <% } %> <% } %> </div> <% }); %>", items_per_page: 16, display_variants: false, facets_included: true, initial_number_of_facets: 3, initial_number_of_facet_values: 6, infinite_scroll: false, sorting_options: [ {label: "Relevance", value: ""}, {label: "Name (A - Z)", value: "title+asc"}, {label: "Name (Z - A)", value: "title+desc"}, {label: "Price (low - high)", value: "sale_price+asc"}, {label: "Price (high - low)", value: "sale_price+desc"} ], is_search_page: false }, autosuggest: { enabled: false, endpoint: "https://suggest.dxpapi.com/api/v1/suggest/", selector: "form[action=\"/search.php\"] input[type=\"text\"], form[action=\"/search.php\"] input[type=\"search\"]", template: "<% if (terms.length || productSuggestions.length) { %> <div class=\"blm-autosuggest\"> <div class=\"blm-autosuggest__suggestion-terms-container\"> <ul class=\"blm-autosuggest__suggestion-terms\"> <% terms.forEach(function(term) { %> <li class=\"blm-autosuggest__suggestion-term\"> <a href=\"<%- term.link %>\" class=\"blm-autosuggest__suggestion-term-link\" data-suggestion-text=\"<%- term.text %>\" ><%- term.processedText %></a > <% if (term.categories) { %> <ul class=\"blm-autosuggest__category-results\"> <% term.categories.forEach(function(category) { %> <li class=\"blm-autosuggest__suggestion-term\"> <a href=\"#\" data-category-id=\"<%- category.value %>\" data-suggestion-text=\"<%- category.name %>\" class=\"blm-autosuggest__suggestion-term-link blm-autosuggest__suggestion-term-link--category\" ><%- category.name %></a > </li> <% }); %> </ul> <% } %> </li> <% }); %> </ul> </div> <div class=\"blm-autosuggest__results-container\"> <div class=\"blm-autosuggest__results\"> <% productSuggestions.forEach(function(suggestion) { %> <div class=\"blm-autosuggest__result\"> <div class=\"blm-autosuggest-result-image\"> <a title=\"<%= suggestion.title %>\" aria-hidden=\"true\" tabindex=\"-1\" href=\"<%= suggestion.link %>\" class=\"blm-autosuggest-result-image__link\" ><img class=\"blm-autosuggest-result-image__image\" src=\"<%= suggestion.image %>\" /></a> </div> <div class=\"blm-autosuggest-result-details\"> <a class=\"blm-autosuggest-result-details__title\" href=\"<%= suggestion.link %>\" ><%= suggestion.title %></a > <div class=\"blm-autosuggest-result-details__price blm-autosuggest-result-details__price--final\"> <% if (config.get('formatMoney')) { %> <%= config.get('formatMoney')(suggestion.final_price.toFixed(2) * 100) %> <% } else { %> <%= defaultCurrency %><%= suggestion.final_price.toFixed(2) %> <% } %> <% if (suggestion.original_price) { %> <span class=\"blm-autosuggest-result-details__price blm-autosuggest-result-details__price--original\" > <% if (config.get('formatMoney')) { %> <%= config.get('formatMoney')(suggestion.original_price.toFixed(2) * 100) %> <% } else { %> <%= defaultCurrency %><%= suggestion.original_price.toFixed(2) %> <% } %> </span > <% } %> </div> </div> </div> <% }); %> </div> </div> </div> <% } %>", number_of_terms: 4, number_of_products: 8, number_of_collections: 8, }, category: { enabled: false, fields: "pid,title,brand,price,sale_price,thumb_image,sku_thumb_images,sku_swatch_images,sku_color_group,url,price_range,sale_price_range,description", endpoint: "https://core.dxpapi.com/api/v1/core/", selector: ".main-content", template: "<div class=\"blm-category <% if (config.get('areFacetsIncluded')) { %>with-facets<% } %>\"> <% if (config.get('areFacetsIncluded') && facets.length) { %> <aside class=\"blm-category-sidebar\"> <button class=\"blm-category-control-button blm-category-control-button--sidebar\"> Filter <svg viewBox=\"0 0 14.8 14.8\" class=\"blm-category-control-button__icon\" focusable=\"false\"><path d=\"M1.6 14.8V0m6 14.8V1.6m5.6 13.2V0\" fill=\"none\" stroke=\"#000\" stroke-miterlimit=\"10\"></path><circle cx=\"1.6\" cy=\"7.4\" r=\"1.6\"></circle><circle cx=\"13.2\" cy=\"10.4\" r=\"1.6\"></circle><circle cx=\"7.6\" cy=\"1.6\" r=\"1.6\"></circle></svg> </button> <div class=\"blm-category-sidebar-content <% if (locals.isFiltersPanelOpened && isFiltersPanelOpened) { %>blm-open<% } %>\"> <button class=\"blm-category-control-button blm-category-control-button--sidebar blm-category-control-button--active\"> Done <svg viewBox=\"0 0 14.8 14.8\" class=\"blm-category-control-button__icon\" focusable=\"false\"><path class=\"blm-category-control-button__icon-path\" d=\"M1.6 14.8V0m6 14.8V1.6m5.6 13.2V0\" fill=\"none\" stroke=\"#000\" stroke-miterlimit=\"10\"></path><circle cx=\"1.6\" cy=\"7.4\" r=\"1.6\"></circle><circle cx=\"13.2\" cy=\"10.4\" r=\"1.6\"></circle><circle cx=\"7.6\" cy=\"1.6\" r=\"1.6\"></circle></svg> </button> <div class=\"blm-category-filter\"> <h4 class=\"blm-category-filter-title\">Price</h4> <div class=\"blm-price-range-container\"> <div class=\"blm-range-slider\"> <input value=\"<%= checkedFacets.price ? checkedFacets.price[0] : priceRangeFacet.start %>\" min=\"<%- priceRangeFacet.start %>\" max=\"<%- priceRangeFacet.end %>\" step=\"1\" type=\"range\" class=\"blm-price-range-input blm-price-range-input--lower blm-price-range-input--lower-%%-REQUEST_ID-%%\" > <span class=\"blm-price-range-slider-rail\"></span> <input value=\"<%= checkedFacets.price ? checkedFacets.price[1] : priceRangeFacet.end %>\" min=\"<%- priceRangeFacet.start %>\" max=\"<%- priceRangeFacet.end %>\" step=\"1\" type=\"range\" class=\"blm-price-range-input blm-price-range-input--upper blm-price-range-input--upper-%%-REQUEST_ID-%%\" > </div> <div class=\"blm-range-slider__values\"> <span class=\"blm-range-slider__values--min\"> <%= checkedFacets.price ? formatMoney(checkedFacets.price[0] * 100) : formatMoney(priceRangeFacet.start * 100) %> </span> <% if (checkedFacets.price) { %> <span class=\"blm-range-slider__values--max\"> <%= checkedFacets.price ? formatMoney(checkedFacets.price[1] * 100) : formatMoney(priceRangeFacet.start * 100) %> </span> <% } else { %> <span class=\"blm-range-slider__values--max\"> <%= formatMoney(priceRangeFacet.end * 100) %> </span> <% } %> </div> <% if (checkedFacets.price) { %> <div class=\"blm-range-slider__clear-values\"> <button class=\"blm-range-slider__clear-values-button blm-range-slider__clear-values-button--%%-REQUEST_ID-%%\">Clear</button> </div> <% } %> </div> </div> <% facets.forEach(function(facet, facetIndex) { %> <% if (facet.section.length > 0) { %> <div class=\"blm-category-filter\" id=\"blm-facet-block-item-<%= facetIndex %>\"> <h4 class=\"blm-category-filter-title\"><%- facet.title %></h4> <ul class=\"blm-category-filter-items\"> <% facet.section.forEach(function(item) { %> <li class=\"blm-category-filter-item\"> <input type=\"checkbox\" <% if (facet.original_title in checkedFacets && checkedFacets[facet.original_title].includes(escapeSpecialCharacters(item.id))) { %>checked<% } %> name=\"<%- facet.original_title %>\" value=\"<%- escapeSpecialCharacters(item.id) %>\" id=\"<%- facet.original_title + '[' + escapeSpecialCharacters(item.name) + ']' %>\" class=\"blm-category-filter-item__checkbox\" /> <label class=\"blm-category-filter-item__name\" for=\"<%- facet.original_title + '[' + escapeSpecialCharacters(item.name) + ']' %>\"><%- item.name %></label> <% if (!config.get('displayVariants')) { %> <span class=\"blm-category-filter-item__badge\"><%- item.count %></span> <% } %> </li> <% }); %> </ul> <% if (facet.section.length > config.get('initialNumberOfFacetValues')) { %> <div class=\"blm-category-load-more\" data-item=\"<%= facetIndex %>\">+ More</div> <% } %> </div> <% } %> <% }); %> <% if (facets[0].section.length) { %> <div class=\"blm-load-more-facet blm-load-more-facet--%%-REQUEST_ID-%%\">+ More </div> <% } %> </div> </aside> <% } %> <section class=\"blm-category-main\"> <div class=\"blm-category-toolbar\"> <% if (locals.number_of_results && number_of_results > 0) { %> <h2 class=\"blm-category-toolbar__title\"> Showing <%- start + 1 %> - <%- Math.min(start + products.length, number_of_results) %> of <%- number_of_results %> products </h2> <div class=\"blm-category-toolbar-options\"> <span class=\"blm-category-toolbar-options blm-category-toolbar-options--page-size\"> <label for=\"sort-size-%%-REQUEST_ID-%%\" class=\"blm-category-toolbar-options__label\">Size: </label> <select name=\"sort-size\" id=\"sort-size-%%-REQUEST_ID-%%\" class=\"blm-category-toolbar-options__select\" > <% for (let i = 16; i <= 48; i += 4) { %> <option value=\"<%- i %>\" <% if (locals.size && size === i) { %>selected<% } %>><%- i %></option> <% } %> </select> </span> <span class=\"blm-category-toolbar-options blm-category-toolbar-options--sort-by\"> <label for=\"sort-by-%%-REQUEST_ID-%%\" class=\"blm-category-toolbar-options__label\">Sort By: </label> <select name=\"sort-by\" id=\"sort-by-%%-REQUEST_ID-%%\" class=\"blm-category-toolbar-options__select\" > <% config.get('sortingOptions').forEach(function(option) { %> <option value=\"<%- option.value %>\" <% if (locals.sort && sort === option.value) { %>selected<% } %>><%- option.label %></option> <% }) %> </select> </span> </div> <% } else { %> <h2 class=\"blm-category-toolbar__title\"> No results found </h2> <% } %> </div> <% if (products.length) { %> <div class=\"blm-category__results\"> %%-PRODUCT_LIST_TEMPLATE-%% </div> <% } %> <% if (!locals.mobileView || !mobileView.matches) { %> <% if (!config.get('infiniteScroll') && paginationData.length > 0) { %> <div class=\"blm-category-pagination\"> <ul class=\"blm-category-pagination__pages blm-category-pagination__pages--%%-REQUEST_ID-%%\"> <% paginationData.forEach(paginationNode => { %> <li class=\"blm-category-pagination__page\"> <button <% if (paginationNode.disabled) { %>disabled<% } %> class=\"blm-category-pagination__page-link <% if (paginationNode.active) { %>blm-category-pagination__page-link--active<% } %>\" data-value=\"<%- paginationNode.value %>\" ><%- paginationNode.label ?? paginationNode.value %></button > </li> <% }) %> </ul> </div> <% } %> <% } %> </section> </div>", product_list_template: "<% products.forEach(function(product) { %> <div class=\"blm-category__result\" <% if (product.variant_name) { %>title=\"<%- product.variant_name %>\"<% } %>> <% const matchingVariant = !Array.isArray(product.variants) ? null : 'variant_index' in product ? product.variants[product.variant_index] : product.variants.find(variant => selectedColors.includes(variant.sku_color_group ? variant.sku_color_group.toLowerCase() : null)) %> <div class=\"blm-category-image-container\"> <% if (product.variants && product.variants.length > 1) { %> <% product.variants.forEach(function(variant, index) { %> <% const isActiveVariant = !('variant_index' in product) && !selectedColors.length ? index === 0 : 'variant_index' in product ? product.variant_index === index : matchingVariant == variant %> <div class=\"blm-category-swatch-image fade\" <% if (isActiveVariant) { %>style=\"display: block\"<% } %> > <img class=\"blm-category-image-container__image\" alt=\"title\" src=\"<%= variant.image %>\" /> </div> <% }); %> <% } else { %> <div class=\"blm-category-swatch-image fade\" style=\"display: block\"> <img class=\"blm-category-image-container__image\" alt=\"title\" src=\"<%= product.image %>\" /> </div> <% } %> </div> <div class=\"blm-category-details-container\"> <div class=\"blm-category-details-title-container\"> <a href=\"<%= product.link %>\" class=\"blm-category-details-container__title\" ><%- product.title %></a > </div> <p class=\"blm-category-details-container__price\"> <% if( product.final_price ) { %> <%= formatMoney(product.final_price.toFixed() * 100) %> <% } %> <span <% if (product.final_price) { %>class=\"blm-category-details-container__price--strike-through\"<% } %>> <%= formatMoney(product.price.toFixed() * 100) %> </span> </p> </div> <% if (product.variants && product.variants.length > 1) { %> <ul class=\"blm-category-swatch-container\"> <% product.variants.slice(0, defaultMaxColorSwatches || 0).forEach(function(variant, index) { %> <% const isActiveVariant = !('variant_index' in product) && !selectedColors.length ? index === 0 : 'variant_index' in product ? product.variant_index === index : matchingVariant == variant %> <li class=\"blm-category-swatch-container__swatch <% if (isActiveVariant) { %>active<% } %>\" style=\"background-image: url('<%= variant.image %>')\" ></li> <% }); %> </ul> <% if (product.variants.length > defaultMaxColorSwatches || 0) { %> <small class=\"blm-category-swatch-colors\">(Colors) <%- product.variants.length %></small> <% } %> <% } %> </div> <% }); %>", items_per_page: 16, facets_included: true, initial_number_of_facets: 3, initial_number_of_facet_values: 6, infinite_scroll: false, sorting_options: [ {label: "Relevance", value: ""}, {label: "Name (A - Z)", value: "title+asc"}, {label: "Name (Z - A)", value: "title+desc"}, {label: "Price (low - high)", value: "sale_price+asc"}, {label: "Price (high - low)", value: "sale_price+desc"} ], infinite_scroll: false, is_category_page: false, category_id: false, }, pixel: { "enabled": false } }; </script><script> console.log("Customer email not available. No tracking data sent."); </script> <style> .gcc-page{font-family:'Open Sans',sans-serif}.gcc-page .col-7{width:54%}.gcc-page .col-5{width:46%}.gcc-page .fl{float:left}.gcc-page .fr{float:right}.gcc-dec{color:#666;font-size:15px}.gcc-dec h2{margin:0 0 20px;padding:0;font-size:36px;color:#56564f;font-family:Amiri,serif;line-height:1.2;font-weight:400}.gcc-dec p{margin:0 0 20px;padding:0}.gcc-dec .padd{max-width:393px;width:90%}.product-form .padd{overflow:hidden;-webkit-box-sizing:border-box;box-sizing:border-box;padding:50px;border:#c8c8c8 solid 1px}.product-form h3{margin:0 0 10px;padding:0;font-size:18px;color:#56564f;font-weight:400;font-family:'Open Sans',sans-serif;color:#333;font-weight:700}.product-form p{color:#666;font-size:15px;margin:0 0 30px;padding:0}.product-form .pdt-dv{width:100%;float:left;margin-bottom:27px}.product-form .pdt-dv label{display:block;font-size:14px;color:#666;padding-bottom:5px}.product-form .pdt-dv input.textbox{border:#ebebe7 solid 1px;-webkit-box-sizing:border-box;box-sizing:border-box;height:40px;background:#fff;width:100%;padding:0 15px}.product-form .pdt-dv input.errorclient{background-color:#f0dddf!important;border:1px solid #9e1b2a!important}small.date-for{color:#9e9e98;font-size:12px;display:block;padding-top:8px}.primary_button{overflow:hidden;cursor:pointer;text-transform:inherit;margin:20px 0 display: block;padding:10px 0;font-size:15px;color:#fff;background-color:#006680!important;font-weight:400;text-align:center;text-shadow:none;border:none;transition:all .3s ease-in;width:100%}.errorform::before{content:"\0021";font-size:14px;vertical-align:text-top;color:#9e1b2a;text-align:center;line-height:1.3;display:inline-block;width:20px;height:20px;border-radius:0;margin:0 10px 0 0;background-color:#fff;font-family:'Open Sans',sans-serif;position:absolute;border-radius:100%;left:10px}.errorform{background-color:#9e1b2a;margin:10px 0;font-family:'Open Sans',sans-serif;color:#fff;font-size:14px;line-height:20px;padding:20px 20px 20px 40px;text-align:left;position:relative}.notic-dv{background:#e6e6e5;text-align:center;padding:15px 25px;font-size:15px;color:#666;margin-top:15px;margin-top:20px}ul.file-link{margin:20px 0 0;padding:0;clear:both}ul.file-link li{list-style:none;background:url(https://cdn8.bigcommerce.com/s-kmr73o5t54/product_images/uploaded_images/arrrow-img.png?t=1519730731) no-repeat left 10px;padding:12px 0 6px 38px;color:#006680;font-size:15px}ul.file-link li+li{margin-top:20px}@media(max-width:767px){.gcc-page .col-7{width:100%}.gcc-page .col-5{width:100%}.product-form .padd{padding:25px}}h1.page-heading.pages-template.page-m{margin:0;padding:0}#tabmenu{margin:0;font-family:'Open Sans',sans-serif}#faq-nav{overflow:hidden;padding-left:0;}#faq-nav li{float:left;list-style:none}#faq-nav li a{display:block;color:#999;font-size:15px;font-weight:700;font-family:'Open Sans',sans-serif;text-decoration:none;border-bottom:#fff solid 2px;padding-bottom:7px}#tab-content{width:100%}#faq-nav li a.active{border-bottom:#333 solid 2px;color:#333}.accordion-dv h4{margin:0 0 12px;color:#56564f;font-size:15px;font-weight:600;font-family:'Open Sans',sans-serif;padding:10px 25px 10px 48px;border:#eaeaea solid 1px;cursor:pointer;background:url(https://cdn8.bigcommerce.com/s-kmr73o5t54/product_images/uploaded_images/p-icon.png?t=1519737178) no-repeat 20px 15px}.accordion-dv h4.active{margin-bottom:0;border-bottom:#f6f6f6 solid 1px;padding-bottom:0;padding-top:20px;background:#f6f6f6 url(https://cdn8.bigcommerce.com/s-kmr73o5t54/product_images/uploaded_images/p-icon-a.png?t=1519737170) no-repeat 20px 25px}.accordion-dv .content{background:#f6f6f6;margin:0;padding:10px 25px 20px 48px;margin-bottom:15px;border:#eaeaea solid 1px;font-family:'Open Sans',sans-serif;color:#666;font-size:15px;border-top:#f6f6f6 solid 1px}.accordion-dv .content a{color:#006680;text-decoration:none}.CartTotalMessage{color:#f70a16;font-size:1.2em;font-weight:700} </style> <script type="text/javascript"> (function e(){var e=document.createElement("script");e.type="text/javascript",e.async=true,e.src="//staticw2.yotpo.com/YtwTsxuVW5PaIeKr7OaarNrbt3B70N3FB1iT6EH9/widget.js";var t=document.getElementsByTagName("script")[0];t.parentNode.insertBefore(e,t)})(); </script> <script> $(document).ready(function () { $('.css-bhz559 span').html('I agree to the storing of cookies on my device to enhance site navigation, analyze site usage, and assist in our marketing efforts. <a href="https://privacy.demdaco.com/consumer/index" target="_blank">Do Not Sell My Personal information</a>'); $('.css-a0j149').html('Agree'); $('.css-a0j149').click(function(){ $('.css-a0j149').html('Agree'); $('.css-bhz559 span').html('I agree to the storing of cookies on my device to enhance site navigation, analyze site usage, and assist in our marketing efforts. <a href="https://privacy.demdaco.com/consumer/index" target="_blank">Do Not Sell My Personal information</a>'); }); var category_page = $(".gcc-page").length; if (category_page) { $('h1.page-heading').addClass('page-m'); } $('#tab-content > div').hide(); $('#tab-content > div:first').show(); $('#faq-nav li').click(function () { $('#faq-nav li a').removeClass("active"); $(this).find('a').addClass("active"); $('#faq-nav li a').attr("aria-expanded", "false"); $(this).find('a').attr("aria-expanded", "true"); $('#tab-content > div').hide(); var indexer = $(this).index(); //gets the current index of (this) which is #nav li $('#tab-content > div:eq(' + indexer + ')').fadeIn(); //uses whatever index the link has to open the corresponding box }); $('#faq-nav li').on('keyup', function(e){ if( e.which == 9 ) { $('#faq-nav li a').removeClass("active"); $(this).find('a').addClass("active"); $('#faq-nav li a').attr("aria-expanded", "false"); $(this).find('a').attr("aria-expanded", "true"); $('#tab-content > div').hide(); var indexer = $(this).index(); //gets the current index of (this) which is #nav li $('#tab-content > div:eq(' + indexer + ')').fadeIn(); //uses whatever index the link has to open the corresponding box } }); $('#faq-nav li:nth-child(1)').on('keyup', function(e){ if( e.which == 13 ) { $('#tab1 .accordion-dv button:first').focus(); } }); $('#faq-nav li:nth-child(2)').on('keyup', function(e){ if( e.which == 13 ) { $('#tab2 .accordion-dv button:first').focus(); } }); $('#faq-nav li:nth-child(3)').on('keyup', function(e){ if( e.which == 13 ) { $('#tab3 .accordion-dv button:first').focus(); } }); $('#faq-nav li:nth-child(4)').on('keyup', function(e){ if( e.which == 13 ) { $('#tab4 .accordion-dv button:first').focus(); } }); $('#faq-nav li:nth-child(5)').on('keyup', function(e){ if( e.which == 13 ) { $('#tab5 .accordion-dv button:first').focus(); } }); $('#faq-nav li:nth-child(6)').on('keyup', function(e){ if( e.which == 13 ) { $('#tab6 .accordion-dv button:first').focus(); } }); $(function () { $('.accordion-dv .content').hide(); $('.accordion-dv button:first').addClass('active').next().slideDown('slow'); $('.accordion-dv button').click(function () { if ($(this).next().is(':hidden')) { $('.accordion-dv button').removeClass('active').next().slideUp('slow'); $(this).toggleClass('active').next().slideDown('slow'); } }); }); // Above this Line }); $(document).ready(function () { $(".sub-btn-blk, .close-dv ").click(function () { $(".fix-form-pop").animate({ height: "toggle", opacity: "toggle" }, "slow"); }); $(".policy-left").prepend($(".page-content h1.page-heading.pages-template")); }); </script> <script type="text/javascript"> $(document).ready(function () { $(".RemoveAllProducts").click(function () { $(".productids").each(function () { var mcqty = $(this).val(); $.ajax({ url: "remote/v1/cart/update", type: 'post', async: false, data: { 'items[0][id]': mcqty, 'items[0][quantity]': '0', }, success: function (data) { return true; }, error: function (XMLHttpRequest, textStatus, errorThrown) { } }); }); var grp = ''; if(grp == 'B2C'){ var d = new Date(); d.setTime(d.getTime() + (1*24*60*60*1000)); var expires = "expires="+ d.toUTCString(); document.cookie = "Ltype=b2clogin;" + expires + ";path=/"; }else{ var d = new Date(); d.setTime(d.getTime() + (1*24*60*60*1000)); var expires = "expires="+ d.toUTCString(); document.cookie = "Ltype=b2blogin;" + expires + ";path=/"; } }); var URI = document.referrer; parts = URI.split("/"); last_part = parts[parts.length - 1]; if (last_part == 'login.php?variable=value') { var url_string = window.location.href; var url = new URL(url_string); var action = url.searchParams.get("action"); if (action == 'order_status') { var homee = 'https://www.demdaco.com/'; window.location = homee; } } else if (last_part == 'login.php') { var url_string = window.location.href; var url = new URL(url_string); var action = url.searchParams.get("action"); if (action == 'order_status') { if (url.searchParams.get("action") == "order_status" && getCookieval("rurl") != "" && getCookieval("rurl") != null) { var homee = 'https://www.demdaco.com/'; var d = new Date(); var rd = getCookieval("rurl"); d.setTime(d.getTime() - (1 * 24 * 60 * 60 * 1000)); var expires = "expires=" + d.toUTCString(); document.cookie = "rurl=;" + expires + ";path=/"; var finalurl = homee + rd; finalurl = finalurl.replace("//", "/"); finalurl = finalurl.replace("//", "/"); finalurl = finalurl.replace("https:/", "https://"); finalurl = finalurl.replace("http:/", "http://"); window.location = finalurl; } else { var homee = 'https://www.demdaco.com/'; var finalurl = homee; var url_string = window.location.href; var url = new URL(url_string); var rd = url.searchParams.get("rd"); if(url.searchParams.get("action") == "order_status" && getCookieval("Ltype")=="retailer_online") { finalurl = finalurl.replace("//", "/"); finalurl = finalurl.replace("//", "/"); finalurl = finalurl.replace("https:/", "https://"); finalurl = finalurl.replace("http:/", "http://"); finalurl = finalurl+"login.php" } } } } }); var url_string = window.location.href; var url = new URL(url_string); var rd = url.searchParams.get("rd"); var usergroup = ''; if (url.searchParams.get("action") == "order_status" && getCookieval("rurl") != "" && getCookieval("rurl") != null) { var homee = 'https://www.demdaco.com/'; var d = new Date(); var rd = getCookieval("rurl"); d.setTime(d.getTime() - (1 * 24 * 60 * 60 * 1000)); var expires = "expires=" + d.toUTCString(); document.cookie = "rurl=;" + expires + ";path=/"; var finalurl = homee + rd; finalurl = finalurl.replace("//", "/"); finalurl = finalurl.replace("//", "/"); finalurl = finalurl.replace("https:/", "https://"); finalurl = finalurl.replace("http:/", "http://"); window.location = finalurl; } if (rd != '' && rd != null) { var d = new Date(); d.setTime(d.getTime() + (1 * 24 * 60 * 60 * 1000)); var expires = "expires=" + d.toUTCString(); document.cookie = "rurl=" + rd + ";" + expires + ";path=/"; } function getCookieval(cname) { var name = cname + "="; var decodedCookie = decodeURIComponent(document.cookie); var ca = decodedCookie.split(';'); for (var i = 0; i < ca.length; i++) { var c = ca[i]; while (c.charAt(0) == ' ') { c = c.substring(1); } if (c.indexOf(name) == 0) { return c.substring(name.length, c.length); } } return ""; } </script> <script type="text/javascript"> $(document).ready(function () { var usergroup = ''; if (usergroup == "Dealer A" || usergroup == "Dealer AT" || usergroup == "Dealer B" || usergroup == "Dealer BT" || usergroup == "Select" || usergroup == "Select T"){ var CartTotal = '0'; var CartTotal = CartTotal.replace('$', ''); var CartTotal = CartTotal.replace(',', ''); if (CartTotal >= 150.0) { $('.CartTotalMessage').hide(); $('.ExpressCheckout').show(); } else { $('.cart-actions a.button').hide(); $('.previewCartAction-checkout a.button').hide(); $('.ExpressCheckout').hide(); $('a.chkbtn').hide(); $('.CartTotalMessage').show(); } } else{ $('.CartTotalMessage').hide(); } $("#gcc-submit-form").submit(function(){ $.ajax({ type: 'HEAD', async: true, crossDomain: true, url: "https://gcc2.demdaco.com/gcc/Images/1004140001;15765-11;01-22-2016.pdf", headers: { 'Access-Control-Allow-Origin': '*' }, success: function() { alert('Page found.'); return false; }, error: function() { alert('Page not found.'); return false; } }); return false; }); }); function doesFileExist(urlToFile) { var xhr = new XMLHttpRequest(); xhr.open('HEAD', urlToFile, false); xhr.send(); if (xhr.status == "404") { alert("File doesn't exist"); return false; } else { alert("File exist"); return false; } return false; } //$(".facetedSearch-toggle-text").text("Browse by Artist, Collection & more"); var str = jQuery(".stock_txt").html(); if(str!=undefined){ var newstr = capitalizeFirstLetterEachWordSplitBySpace(str); jQuery(".stock_txt").html(newstr); } function capitalizeFirstLetterEachWordSplitBySpace(str) { var words = str.split(" "); var output = ""; for (i = 0; i < words.length; i++) { lowerWord = words[i].toLowerCase(); lowerWord = lowerWord.trim(); capitalizedWord = lowerWord.slice(0, 1).toUpperCase() + lowerWord.slice(1); output += capitalizedWord; if (i != words.length - 1) { output += " "; } }//for output[output.length - 1] = ''; return output; } /*jQuery(document).ready(function(e) { jQuery(function() { jQuery(window).resize(function() { if (jQuery(window).width() >= 768) { jQuery( ".productView-images" ).insertAfter( jQuery( " .productView .productView-details:first-child" ) ); } if (jQuery(window).width() <= 767) { jQuery( ".productView-images" ).insertBefore( jQuery( " .productView .productView-details:first-child .productView-price" ) ); } }).resize(); }); });*/ </script> <script> function cartpreview(){jQuery("#cart-preview-dropdown").show()}jQuery(window).on("load",function(){jQuery(".addToCartItem").click(function(){console.log("clicked FS");var o=$(this).attr("data-pro-id");jQuery(this).text("Adding to cart..."),$.ajax({url:"https://www.demdaco.com/cart.php?action=add&product_id="+o+"&qty=1",type:"post",async:!1,data:{action:"add",product_id:o,qty:1},success:function(t){document.getElementById("cartBtn").click(),setTimeout(cartpreview,1200),jQuery("#addtocartCta"+o+" a").text("Added to Cart"),jQuery("html, body").animate({scrollTop:0},900)},error:function(t,o,a){}})})}); </script> <div id="popupLoginWindow" class="modal modal--small modal--pupuploginWindow" data-reveal> <div class="modal-header"> <h2>Sign In</h2> <a href="#" class="modal-close" aria-label="Close" role="button"><span aria-hidden="true">×</span></a> </div> <div class="modal-body"> <div class="alertBox alertBox--error" style="display: none;"> <div class="alertBox-column alertBox-icon"> <icon glyph="ic-error" class="icon" aria-hidden="true"> <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"></path></svg> </icon> </div> <p class="alertBox-column alertBox-message"><span>Oops, something went wrong. Please try again.</span></p> </div> <div class="alertBox alertBox--success" style="display: none;"> <div class="alertBox-column alertBox-icon"> <icon glyph="ic-success" class="icon" aria-hidden="true"> <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"></path></svg> </icon> </div> <p class="alertBox-column alertBox-message"><span>You are now logged in!</span></p> </div> <form class="form" id="popupLoginWindowForm"> <div class="form-field"> <label class="form-label" for="login_email">Email Address:</label> <input class="form-input" name="login_email" id="login_email" type="email" placeholder="guest@guest.com"> </div> <div class="form-field"> <label class="form-label" for="login_pass">Password:</label> <input class="form-input" id="login_pass" type="password" name="login_pass" placeholder="guest123"> </div> <div class="form-actions"> <a class="forgot-password" href="/login.php?action=reset_password">Forgot password?</a> <input type="submit" for="submit" class="button button--primary" value="Sign in"> </div> </form> <div class="new-customer-div"> <p>New to DEMDACO? <a href="/login.php?action=create_account">Create Account</a></p> </div> </div> <div class="loadingOverlay" style="display: none;"></div> </div> <div data-findify-event="update-cart"> </div> <!--BEGIN QUALTRICS WEBSITE FEEDBACK SNIPPET--> <div id="ZN_9oAOmpuabHD9U6G"><!--DO NOT REMOVE-CONTENTS PLACED HERE--></div> <!--END WEBSITE FEEDBACK SNIPPET--> <script> document.addEventListener('DOMContentLoaded', function () { (function(){var g=function(e,h,f,g){ this.get=function(a){for(var a=a+"=",c=document.cookie.split(";"),b=0,e=c.length;b<e;b++){for(var d=c[b];" "==d.charAt(0);)d=d.substring(1,d.length);if(0==d.indexOf(a))return d.substring(a.length,d.length)}return null}; this.set=function(a,c){var b="",b=new Date;b.setTime(b.getTime()+6048E5);b="; expires="+b.toGMTString();document.cookie=a+"="+c+b+"; path=/; "}; this.check=function(){var a=this.get(f);if(a)a=a.split(":");else if(100!=e)"v"==h&&(e=Math.random()>=e/100?0:100),a=[h,e,0],this.set(f,a.join(":"));else return!0;var c=a[1];if(100==c)return!0;switch(a[0]){case "v":return!1;case "r":return c=a[2]%Math.floor(100/c),a[2]++,this.set(f,a.join(":")),!c}return!0}; this.go=function(){if(this.check()){var a=document.createElement("script");a.type="text/javascript";a.src=g;document.body&&document.body.appendChild(a)}}; this.start=function(){var t=this;"complete"!==document.readyState?window.addEventListener?window.addEventListener("load",function(){t.go()},!1):window.attachEvent&&window.attachEvent("onload",function(){t.go()}):t.go()};}; try{(new g(100,"r","QSI_S_ZN_9oAOmpuabHD9U6G","https://zn9oaompuabhd9u6g-demdaco.siteintercept.qualtrics.com/SIE/?Q_ZID=ZN_9oAOmpuabHD9U6G")).start()}catch(i){}})(); }, false); </script> </body> </html> <style> /* Loader Styles - Removed as we're using toast for loading */ .AddtoCart.isopen { box-shadow: 0px 0px 5px 0px #000; } /* Toast Container */ #toast-container { position: fixed; top: 20px; right: 20px; z-index: 9999; } /* Individual Toast */ .toast { display: flex; align-items: center; background-color: #333; color: #fff; padding: 16px 24px; margin-bottom: 10px; border-radius: 8px; box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); opacity: 0; transform: translateX(100%); animation: slideIn 0.5s forwards, fadeOut 0.5s forwards 2.5s; min-width: 250px; } /* Icon (Optional) */ .toast .icon { margin-right: 12px; font-size: 20px; } /* Message */ .toast .message { flex: 1; } /* Animation for sliding in */ @keyframes slideIn { to { opacity: 1; transform: translateX(0); } } /* Animation for fading out */ @keyframes fadeOut { to { opacity: 0; transform: translateX(100%); } } /* Disabled Button Styling (Optional) */ button.disabled { opacity: 0.6; cursor: not-allowed; } .cartQuantity { display: inline-block; width: 32px; /* Adjust size as needed */ height: 32px; line-height: 32px; /* Vertically center the text */ border-radius: 50%; /* Make it a perfect circle */ background-color: #FFFFFF; text-align: center; font-weight: bold; font-size: 16px; } </style> <div class="modalMobile hide wishlistProduct"> <div class="modalMobileContainer "> <div class="details"> <form id="wishlistForm"> <!-- Select Existing Wishlist --> <div class="form-group" id="existingWishlistGroup"> <label class="form-label" for="existingWishlist">Choose an existing Wishlist:</label> <select id="existingWishlist" class="form-select" name="existingWishlist"> </select> </div> <!-- Create a New Wishlist --> <div class="form-group AddNew hide" id="newWishlistGroup" > <label class="form-label" for="newWishlist">Create a new one:</label> <input type="text" id="newWishlist" name="newWishlist" class="form-input" placeholder="Enter Wishlist name"> </div> <div class="form-group buttonsGroup"> <button type="button" id="createNewBtn">Create New Wishlist</button> <button type="button" id="useExistingBtn">Add to Selected Wishlist</button> </div> </form> </div> </div> </div> <script> window.defaultimage = 'https://cdn11.bigcommerce.com/s-kmr73o5t54/stencil/34f13a70-71fa-013d-d0ed-6e3ef077b7cf/e/18cdf900-d520-013d-6672-2a37379de8c6/img/ProductDefault.gif'; // FIRST // Get Data function formatCurrency(value) { return new Intl.NumberFormat('en-US', { style: 'currency', currency: 'USD', minimumFractionDigits: 2 }).format(value); } // Filter Functions function updatePageInfo(change) { const currentPageElement = document.getElementById("currentPage"); let currentPage = parseInt(currentPageElement.innerText); currentPage += change; currentPageElement.innerText = currentPage; } function pageCountTotal(){ //document.querySelector('.productCount').innerHTML = `1-${NumberPerPage()} of ${collectionInfo.totalItems} products`; document.querySelector('.productCount').innerHTML = `${collectionInfo.totalItems} products`; } function appliedFilters() { const FiltersContainer = document.querySelector('.appliedFilters'); //console.log("activeFilters for Applied Filters", activeFilters); if (activeFilters && Array.isArray(activeFilters)) { // Safeguard against undefined and check if it's an array FiltersContainer.innerHTML = activeFilters.map(filter => { if (filter && Array.isArray(filter.value)) { // Check if filter and filter.value exist and are arrays ${val === 'Y' ? 'Sales' : val} return filter.value.map(val => ` <div data-facetname="${filter.key}" class="filter" data-facetvalue="${val}">${val === 'Y' ? 'Sales' : val}</div> `); } else { console.error("Invalid filter or filter.value:", filter); return ""; // Return empty string to avoid breaking the join('') } }).flat().join(''); } else { console.error("ActiveFilters is not defined or not an array:", activeFilters); } } function removeFilter(filterName, filterValue) { let index = activeFilters.findIndex(f => f.key === filterName && f.value.includes(filterValue)); if (index !== -1) { let filterObj = activeFilters[index]; // Remove the filter value from the array filterObj.value = filterObj.value.filter(v => v !== filterValue); // If the array becomes empty, remove the filter object entirely if (filterObj.value.length === 0) { activeFilters.splice(index, 1); } // Debugging //console.log("Trying to find section for:", filterName); // Uncheck the corresponding checkbox const section = document.querySelector(`#accordion-section-${filterName}`); if (section) { const checkbox = section.querySelector(`input[data-filtername="${filterName}"][id="${filterValue}"]`); if (checkbox) { //console.log("Checkbox found. Unchecking."); checkbox.checked = false; } else { //console.log("Checkbox not found."); } } else { //console.log("Section not found."); } updateURLWithFacets(activeFilters); updatePriceRangeURL() sortByUrlUpdate() build(1); fetchAndBuildProductAttributes(true); } } function sortByUrlUpdate() { // const url = new URL(window.location.href); // const sortElement = document.getElementById("sort"); // const sortBy = sortElement.value || "NEWEST"; // Use default value if not found // url.searchParams.set('sortby', sortBy); // window.history.replaceState({}, '', url); } let isInitialized = false; // Flag to check if the initial setup is done function sortBySelection() { const url = new URL(window.location.href); let currentSortBy = url.searchParams.get('sortby'); let sortElement = document.getElementById("sort"); let sortBy; if (!isInitialized) { if (currentSortBy && sortElement.value !== currentSortBy) { let isValidOption = Array.from(sortElement.options).some(option => option.value === currentSortBy); if (isValidOption) { sortElement.value = currentSortBy; } else { sortElement.value = "BEST_SELLING"; } } sortBy = sortElement.value || "BEST_SELLING"; isInitialized = true; } else { sortBy = sortElement.value; } if (currentSortBy !== sortBy) { url.searchParams.set('sortby', sortBy); window.history.replaceState({}, '', url); } return sortBy; } function updatePriceRangeURL() { const url = new URL(window.location.href); let minPriceElement = document.getElementById("minPrice"); let maxPriceElement = document.getElementById("maxPrice"); let minPriceInput = minPriceElement.value; let maxPriceInput = maxPriceElement.value; // Set input fields from URL if they are empty if (!minPriceInput && url.searchParams.get('minPrice')) { minPriceInput = url.searchParams.get('minPrice'); minPriceElement.value = minPriceInput; } if (!maxPriceInput && url.searchParams.get('maxPrice')) { maxPriceInput = url.searchParams.get('maxPrice'); maxPriceElement.value = maxPriceInput; } // Validate and parse input values let minPrice = isNaN(parseInt(minPriceInput)) || parseInt(minPriceInput) <= 0 ? null : parseInt(minPriceInput); let maxPrice = isNaN(parseInt(maxPriceInput)) || parseInt(maxPriceInput) <= 0 ? null : parseInt(maxPriceInput); // Update URL parameters if (minPrice != null) { url.searchParams.set('minPrice', minPrice); } else { url.searchParams.delete('minPrice'); } if (maxPrice != null) { url.searchParams.set('maxPrice', maxPrice); } else { url.searchParams.delete('maxPrice'); } // Update browser history state window.history.replaceState({}, '', url); } let isInitializedPrice = false; // Flag to check if the initial setup is done function updateURLWithPrice(minPrice, maxPrice) { const url = new URL(window.location.href); // Update URL only if at least one price value is not null/undefined if (minPrice != null || maxPrice != null) { if (minPrice != null) { url.searchParams.set('minPrice', minPrice); } else { url.searchParams.delete('minPrice'); } if (maxPrice != null) { url.searchParams.set('maxPrice', maxPrice); } else { url.searchParams.delete('maxPrice'); } window.history.replaceState({}, '', url); } } function priceRange() { if (!isInitializedPrice) { // On initial load, set the price inputs based on URL params if they exist const url = new URL(window.location.href); let minPriceFromURL = url.searchParams.get('minPrice'); let maxPriceFromURL = url.searchParams.get('maxPrice'); if (minPriceFromURL != null) { document.getElementById("minPrice").value = minPriceFromURL; } if (maxPriceFromURL != null) { document.getElementById("maxPrice").value = maxPriceFromURL; } isInitializedPrice = true; } else { // Handle user input changes let minPriceInput = document.getElementById("minPrice").value; let maxPriceInput = document.getElementById("maxPrice").value; let minPrice = isNaN(parseInt(minPriceInput)) || parseInt(minPriceInput) <= 0 ? null : parseInt(minPriceInput); let maxPrice = isNaN(parseInt(maxPriceInput)) || parseInt(maxPriceInput) <= 0 ? null : parseInt(maxPriceInput); // Don't update the URL if both minPrice and maxPrice are null or undefined if (minPrice != null || maxPrice != null) { updateURLWithPrice(minPrice, maxPrice); } } } function searchPrice() { const url = new URL(window.location.href); // Retrieve values from URL search parameters or from input elements if they exist. const minPriceFromURL = url.searchParams.get('minPrice'); const maxPriceFromURL = url.searchParams.get('maxPrice'); // Safely check if DOM elements exist and then use their values if they do. let minPriceElement = document.getElementById("minPrice"); let maxPriceElement = document.getElementById("maxPrice"); let minPrice = minPriceElement ? minPriceElement.value : minPriceFromURL; let maxPrice = maxPriceElement ? maxPriceElement.value : maxPriceFromURL; // Normalize values to ensure they are not empty strings and '0' is considered valid. minPrice = (minPrice !== null && minPrice !== undefined && minPrice !== "") ? minPrice : undefined; maxPrice = (maxPrice !== null && maxPrice !== undefined && maxPrice !== "") ? maxPrice : undefined; // Construct and return the price string based on the available data. if (minPrice !== undefined && maxPrice !== undefined) { priceRange() return `price: { minPrice: ${minPrice}, maxPrice: ${maxPrice} },`; } else if (minPrice !== undefined) { priceRange() return `price: { minPrice: ${minPrice} },`; } else if (maxPrice !== undefined) { priceRange() return `price: { maxPrice: ${maxPrice} },`; } else { priceRange() return ""; // Return an empty string if neither price is available. } } // function sortBySelection(){ // let sortBy = document.getElementById("sort").value; // if(sortBy){ // return sortBy; // } else{ // return "NEWEST"; // } // } function NumberPerPage(){ let perPageSelect = document.getElementById("perPageSelect").value; if(perPageSelect){ return perPageSelect; } else{ return "20"; } } function searchFor(){ let search = document.getElementById("searchPLP").value; if(search){ return 'searchTerm: "' + search + '"'; } else{ return ""; } } function updateActiveFilters(filterName, filterValue, isChecked) { //console.log(`Updating activeFilters with filterName: ${filterName}`); // Find the existing filter for the given attribute name let existingFilter = activeFilters.find(f => f.key === filterName); //console.log("existingFilter", existingFilter); if (isChecked) { if (existingFilter) { if (!existingFilter.value.includes(filterValue)) { existingFilter.value.push(filterValue); } } else { activeFilters.push({ key: filterName, value: [filterValue] }); } } else { if (existingFilter) { const index = existingFilter.value.indexOf(filterValue); if (index > -1) { existingFilter.value.splice(index, 1); } if (existingFilter.value.length === 0) { const filterIndex = activeFilters.indexOf(existingFilter); if (filterIndex > -1) { activeFilters.splice(filterIndex, 1); } } } } //console.log("activeFilters", activeFilters); } // Function to update active query based on selected price filters function updateActiveQuery() { // console.log("Function is running"); // Select all checked price filter checkboxes const checkedPriceFilters = document.querySelectorAll('.price-filter:checked'); if (checkedPriceFilters.length === 0) { // No price filters selected; remove minPrice and maxPrice from URL const url = new URL(window.location.href); url.searchParams.delete('minPrice'); url.searchParams.delete('maxPrice'); window.history.replaceState({}, '', url); // Clear the input fields document.getElementById("minPrice").value = ''; document.getElementById("maxPrice").value = ''; console.log("No price filters selected. URL parameters removed."); return; } let minPrices = []; let maxPrices = []; checkedPriceFilters.forEach(filter => { const queryValue = filter.getAttribute('data-qureyvalue_name'); // console.log("Processing filter:", queryValue); // Split the QueryValue on any dash (hyphen, en dash, em dash) const [rawMinPrice, rawMaxPrice] = queryValue.split(/[-—–]/); // Remove non-numeric characters and parse the prices const parsedMinPrice = parseFloat(rawMinPrice.replace(/[^0-9.]/g, '')); const parsedMaxPrice = rawMaxPrice ? parseFloat(rawMaxPrice.replace(/[^0-9.]/g, '')) : null; // Handle $100.00+ if (!isNaN(parsedMinPrice)) { minPrices.push(parsedMinPrice); } if (parsedMaxPrice !== null && !isNaN(parsedMaxPrice)) { maxPrices.push(parsedMaxPrice); } }); // Determine the overall min and max const overallMinPrice = Math.min(...minPrices); const overallMaxPrice = maxPrices.length > 0 ? Math.max(...maxPrices) : null; // Handle cases with no upper limit // console.log("Overall minPrice:", overallMinPrice, "Overall maxPrice:", overallMaxPrice); const url = new URL(window.location.href); const minPriceElement = document.getElementById("minPrice"); const maxPriceElement = document.getElementById("maxPrice"); // Update URL parameters url.searchParams.set('minPrice', overallMinPrice); if (overallMaxPrice !== null) { url.searchParams.set('maxPrice', overallMaxPrice); } else { url.searchParams.delete('maxPrice'); } // Update browser history state window.history.replaceState({}, '', url); // Update input fields minPriceElement.value = overallMinPrice; maxPriceElement.value = overallMaxPrice !== null ? overallMaxPrice : ''; // console.log("URL updated with minPrice and maxPrice."); } // Product Functions function isNew(data, value, trueValue, htmlIfTrue, htmlIfFalse) { const foundItem = data.find(item => item.node.name === value); if (foundItem && foundItem.node.value === trueValue) { return htmlIfTrue; } else { return htmlIfFalse; } } function isCallout(productPrice, htmlIfTrue, htmlIfFalse = '') { if (productPrice && productPrice > 75) { return htmlIfTrue; } else { return htmlIfFalse; } } let customerWishlist; // Declare the variable in an outer scope function getWishlist() { const wishLists = `query { customer { wishlists { edges { cursor node { name entityId } } } } }`; // console.log(wishLists) GraphQLCall(wishLists) .then(data => { if (data && data.data && data.data.customer && data.data.customer.wishlists) { const edges = data.data.customer.wishlists.edges; customerWishlist = edges.map(edge => ({ entityId: edge.node.entityId, name: edge.node.name })); } else { const wishlistAddElements = document.querySelectorAll('.wishlistAdd'); if (wishlistAddElements.length > 0) { wishlistAddElements.forEach((element) => { element.style.display = 'none'; }); } } }) .catch(error => { console.error("Failed to get Product Data " + error); }); } function ListedWishlists(productID) { if (customerWishlist && customerWishlist.length > 0) { const wishlistHtml = customerWishlist.map(wishlist => { // return `<option data-wishlist-action="" formaction="/wishlist.php?action=add&wishlistid=${wishlist.entityId}&product_id=${productID}" type="submit" value="${wishlist.name}">${wishlist.name}</option>`; }).join(''); return wishlistHtml; } return ''; } function AddtoWishlist() { document.querySelectorAll('.wishlistAdd').forEach((wishlistBTN) => { wishlistBTN.addEventListener('click', (event) => { var ModalOpen = document.querySelector(".wishlistProduct"); ModalOpen.classList.remove("hide"); //console.log("Clicked element:", event.target.closest('.productCard').getAttribute('data-product-id')); ModalOpen.querySelector('#existingWishlist').innerHTML = `${ListedWishlists(event.target.closest('.productCard').getAttribute('data-product-id'))}`; }); }); } function addtoCustomerWishlist(element) { //console.log("Clicked element:", element); } function updateURLWithFacets() { let newURL = '/shop-by'; let queryStrings = {}; let values = []; if (!Array.isArray(activeFilters)) { console.error("activeFilters should be an array:", activeFilters); return; } if (activeFilters && activeFilters.length > 0) { // console.log("these are the active filters:", activeFilters); activeFilters.forEach(filter => { if (filter && filter.key && Array.isArray(filter.value)) { // const key = filter.key.toLowerCase().replace(/[_\s]/g, '-'); const key = filter.key.replace(/[_\s]/g, '-'); if (queryStrings[key]) { queryStrings[key].push(...filter.value); } else { queryStrings[key] = [...filter.value]; } values.push(...filter.value); } }); } let isFirstAttribute = true; let additionalParams = []; for (const [key, valArr] of Object.entries(queryStrings)) { if (isFirstAttribute) { // newURL += `/${key}/${valArr[0].toLowerCase().replace(/[_\s]/g, '-')}`; newURL += `/${key}/${valArr[0].replace(/[_\s]/g, '-')}`; isFirstAttribute = false; } else { // newURL += `/${key}/${valArr[0].toLowerCase().replace(/[_\s]/g, '-')}`; newURL += `/${key}/${valArr[0].replace(/[_\s]/g, '-')}`; } if (valArr.length > 1) { additionalParams.push(`Additional${key}=${valArr.slice(1).join(':')}`); } } if(additionalParams.length > 0){ newURL += '?' + additionalParams.join('&'); } // updatePageTitle(); // updateCanonicalURL(); // updatePageh1Title() const title = document.title; history.pushState(activeFilters, title, newURL); } function consolidateFilters(activeFilters) { const consolidated = {}; for (const filter of activeFilters) { const { attribute, values } = filter; if (!consolidated[attribute]) { consolidated[attribute] = []; } consolidated[attribute] = [...new Set([...consolidated[attribute], ...values])]; } return Object.entries(consolidated).map(([key, value]) => ({ attribute: key, values: value })); } function QureyBuilt(productAttributes, afterArgument = ''){ let perPageArgument = `first: ${NumberPerPage()}`; // Default to 'first' argument if (isFirstRun) { const params = new URLSearchParams(window.location.search); const endCursor = params.get('endCursor'); if (endCursor) { afterArgument = `, after: "${endCursor}"`; document.querySelector('.productCount').insertAdjacentHTML('afterend', '<div class="previousProducts" onclick="seePreviousPage()"> <div class="imageButton">SEE PREVIOUS products</div> </div>') } isFirstRun = false; } if (afterArgument.includes("before")) { perPageArgument = `last: ${NumberPerPage()}`; } const productAttributesStr = activeFilters.map(filter => { if (!filter) { return ""; } // ${att} const valuesStr = filter.value.map(v => `"${v}"`).join(", "); return `{attribute: "${filter.key}", values: [${valuesStr}]}`; }).join(", "); if (productAttributesStr == "") { att = '{attribute: "dept", values: ["home", "kitchen", "toys-and-games", "fashion"]}' } else { att = productAttributesStr; } products = `query { site { search { searchProducts( filters: { hideOutOfStock: true, ${searchPrice()} ${searchFor()} productAttributes:[${att}] } sort: ${sortBySelection()} ) { filters(first: 20) { edges { node { ... on ProductAttributeSearchFilter { __typename name filterName displayProductCount attributes(first: 50) { edges { node { value productCount isSelected } cursor } pageInfo { hasNextPage hasPreviousPage startCursor endCursor } } isCollapsedByDefault } name ... on CategorySearchFilter { __typename categories { edges { node { name entityId isSelected } cursor } pageInfo { endCursor hasNextPage hasPreviousPage startCursor } } name } } cursor } pageInfo { startCursor hasPreviousPage hasNextPage endCursor } } products(${perPageArgument} ${afterArgument}) { edges { node { id entityId name sku path customFields { edges { node { name value } } } defaultImage { img320px: url(width: 320) img640px: url(width: 640) img960px: url(width: 960) img1280px: url(width: 1280) altText } prices { mapPrice { value currencyCode } salePrice { value currencyCode } basePrice { value currencyCode } price { value currencyCode } retailPrice { value currencyCode } } addToCartUrl availabilityV2 { ... on ProductAvailable { status } ... on ProductPreOrder { status willBeReleasedAt { utc } } ... on ProductUnavailable { status } status } brand { name id entityId defaultImage { altText isDefault url(width: 640) urlOriginal } } giftWrappingOptions { edges { node { name allowComments } } } depth { value unit } height { unit value } images { edges { node { altText isDefault url(width: 640) urlOriginal } cursor } } metafields(namespace: "digitalFormats") { edges { node { entityId id key value } } } inventory { aggregated { availableToSell warningLevel } isInStock hasVariantInventory } minPurchaseQuantity productOptions { edges { cursor node { isRequired displayName isVariantOption } } } showCartAction weight { unit value } width { unit value } warranty } cursor } collectionInfo { totalItems } pageInfo { hasPreviousPage hasNextPage endCursor startCursor } } } } } }`; // for debugging // console.log(products) return products; } function breadcrumbsBuild() { const breadcrumbsElement = document.querySelector('.BreadcrumbsPLP'); breadcrumbsElement.innerHTML = ""; // Safeguard against undefined and check if it's an array if (activeFilters && Array.isArray(activeFilters)) { activeFilters.forEach(filter => { // Safeguard against undefined 'value' if (filter && Array.isArray(filter.value)) { filter.value.forEach(val => { let breadcrumb = ` <span class="breadcrumbPLP"> <a href="/shop-by/?${filter.key}=${val}">${val === 'Y' ? 'Sales' : val}</a> </span> / `; breadcrumbsElement.insertAdjacentHTML('beforeend', breadcrumb); }); } }); } else { console.error("ActiveFilters is not defined or not an array:", activeFilters); } } function buildProducts(productData, buildProducts) { let listedDocuments = "" let position = 'beforeend' if (buildProducts) { listedDocuments = document.querySelector(buildProducts); //console.log("buildProducts", listedDocuments); if(buildProducts == '#startMoreProducts'){ position = 'afterbegin' } else{ position = 'beforeend' } } else{ listedDocuments = document.querySelectorAll('.productGridFacets')[0]; position = 'beforeend' } // style="display: none;" // ${isNew(product.node.customFields.edges, "Format", 'Plate', `<div class="flag-primary-new">Plate</div>`, ``)} // ${isNew(product.node.customFields.edges, "deals", 'flash-sale', `<div class="flag-primary-new" style="background-color: #89A47C; ">Flash Sale 50% Off</div>`, ``)} productData.forEach(product => { listedDocuments.insertAdjacentHTML(position, ` <li id="${product.node.entityId}" data-sku="${product.node.sku}" class="productCard" data-product-id="${product.node.entityId}"> <div class="productImage"> <div class="flags"> </div> <div class="wishlistAdd" style="display: none;"> <div class="dropdownWishlist"> <form action="/wishlist.php?action=add&product_id=${product.node.entityId}" class="form form-action" data-wishlist-add method="post"> <select class="" name="" data-dropdown-content id="wishlist-dropdown${product.node.entityId}"> ${ListedWishlists(product.node.entityId)} <option value="Add to Wish List" selected="">Add to Wish List</option> <option data-wishlist="" href="wishlist.php?action=add&product_id=${product.node.entityId}" role="button" value="Create New Wish List">Create New Wish List</option> </select> </form> </div> <div class="iconWishlist"> <img class="lazyload" src="https://store-kmr73o5t54.mybigcommerce.com/content/icons/newIcons/icon-wishlist.svg" alt="Add to Wishlist"> </div> </div> <button id="addtocartbtnact-${product.node.entityId}" onclick="addToCart(this, ${product.node.entityId}); increaseBtn(document.querySelector('#addtocartbtn-${product.node.entityId} .IncreaseCart'), ${product.node.entityId});" class="button button--small card-figcaption-button AddtoCartBTN" data-product-id="${product.node.entityId}" data-sku="${product.node.sku}">Add To Cart</button> <div id="addtocartbtn-${product.node.entityId}" class="AddtoCart ProductFormOptions" method="post"> <button onclick="decreaseBtn(this, ${product.node.entityId})" class="DecreaseCart decreaseBtn" data-action="dec">-</button> <span class="cartQuantity" tabindex="0" >0x</span> <!-- Added tabindex="0" for keyboard accessibility --> <button onclick="increaseBtn(this, ${product.node.entityId})" class="IncreaseCart increaseBtn" data-action="inc">+</button> <input name="action" type="hidden" value="add"> <input name="product_id" type="hidden" value="${product.node.entityId}"> </div> <button class="button button--small card-figcaption-button quickview" data-product-id="${product.node.entityId}" data-sku="${product.node.sku}">Quick view</button> <a href="${product.node.path}"> <img class="lazyload" src="${product && product.node && product.node.defaultImage && product.node.defaultImage.img640px ? product.node.defaultImage.img640px : 'https://cdn11.bigcommerce.com/s-kmr73o5t54/stencil/43a2ac60-298d-013c-a09e-322081813f29/e/93891db0-3e73-013c-bfab-02905a0c89a0/img/ProductDefault.gif'}" alt=""> </a> </div> <div class="productDetails"> <div class="midRow"> <p class="productTitle">${product.node.name}</p> </div> <div class="topRow"> <p style="font-weight: bold;">${formatCurrency(product.node.prices.price.value)}</p> <p> <span class="price price--non-sale" style="color: #9a3324 !important; margin-left: 10px; font-weight: bold;"> ${product.node.prices.price.value < product.node.prices.basePrice.value ? formatCurrency(product.node.prices.basePrice.value) : ''} </span> </p> <div class="review"> <div class="yotpo bottomLine" data-product-id="${product.node.entityId}" data-sku="${product.node.sku}"></div> </div> </div> <div class="bottomRow"> <div class="tags" style='display: none; '> <p>10.5' X 5'</p> <p>10.5' X 5'</p> <p>10.5' X 5'</p> </div> <div class="callout" style='display: flex;'> ${isCallout(product.node.prices.price.value, '<img class="lazyload" src="https://store-kmr73o5t54.mybigcommerce.com/content/icons/newIcons/freeShippingIconSolid.svg" alt="Shipping Icon"><p>Free Shipping!</p>')} </div> <div class="colors" style='display: none; '> <div data-color="#2b2b2b" class="color"></div> <div data-color="#2b2b2b" class="color"></div> <div data-color="#2b2b2b" class="color"></div> <div data-color="#2b2b2b" class="color"></div> </div> </div> </div> </li> `) }) runAfter() } // WIP let isEventHandled = false; /** * Adds a product to the cart using the /cart.php URL (without redirection). * @param {number} productID - The ID of the product to add. * @param {number} qty - The quantity to add (default is 1). */ function addtocartAPI(productID, qty = 1) { const url = `/cart.php?action=add&product_id=${productID}&qty=${qty}`; fetch(url, { method: 'GET', credentials: 'same-origin' }) .then((res) => { if (!res.ok) { throw new Error('Failed to add product to cart'); } console.log(`Product ${productID} with quantity ${qty} added to the cart.`); // Optionally update the UI here, such as showing a message or updating the cart icon }) .catch((error) => { console.error('Error:', error); }); } // Function to make the GraphQL call with the given query and variables function GraphQLCallCart(query, variables = {}) { return fetch("/graphql", { method: 'POST', credentials: 'include', mode: 'cors', headers: { 'Content-Type': 'application/json', 'Authorization': `Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJFUzI1NiJ9.eyJjaWQiOlsxXSwiY29ycyI6WyJodHRwczovL3d3dy5kZW1kYWNvLmNvbSJdLCJlYXQiOjE3NDA3NTAwNjMsImlhdCI6MTc0MDU3NzI2MywiaXNzIjoiQkMiLCJzaWQiOjk5OTcxOTY2Niwic3ViIjoiQkMiLCJzdWJfdHlwZSI6MCwidG9rZW5fdHlwZSI6MX0.u79r7CpDX4T61cYP3ugBA_Ba7dvOCquqmlMvq9R9pgZR_ayX88blVMO2YpN4C1BHw0KAf8XX6XLqFB2890PDYA` // Ensure `settings` is accessible }, body: JSON.stringify({ query, variables }), }) .then(res => { if (!res.ok) { return res.json().then(errorData => { throw new Error(`Network response was not ok: ${res.status} - ${JSON.stringify(errorData.errors)}`); }); } return res.json(); }) .then(data => { if (data.errors) { console.error("GraphQL Errors: ", data.errors); throw new Error(`GraphQL errors: ${JSON.stringify(data.errors)}`); } return data; }); } function addtocartremove(productID, quantityToRemove = 1) { const getCartQuery = ` query getCart { site { cart { entityId lineItems { physicalItems { entityId productEntityId quantity } } } } } `; GraphQLCallCart(getCartQuery) .then(data => { if (!data || !data.data || !data.data.site || !data.data.site.cart) { throw new Error("Invalid response structure."); } const cart = data.data.site.cart; const cartId = cart.entityId; // Find the line item for the given productID console.log("Current cart items:", cart.lineItems.physicalItems); console.log("Searching for Product ID:", productID); const lineItem = cart.lineItems.physicalItems.find(item => item.productEntityId.toString() === productID.toString()); if (lineItem) { const lineItemId = lineItem.entityId; const productEntityId = lineItem.productEntityId; // Get the productEntityId from the lineItem const currentQuantity = lineItem.quantity; // Calculate the new quantity const newQuantity = currentQuantity - quantityToRemove; if (newQuantity > 0) { console.log(`Updating cart: Cart ID = ${cartId}, Line Item ID = ${lineItemId}, Product Entity ID = ${productEntityId}, New Quantity = ${newQuantity}`); updateCartLineItem(cartId, lineItemId, newQuantity, productEntityId); } else if (newQuantity === 0) { console.log(`Removing item from cart: Cart ID = ${cartId}, Line Item ID = ${lineItemId}`); // removeCartLineItem(cartId, lineItemId); deleteCartLineItem(cartId, lineItemId) } else { console.log("Cannot decrease quantity below 0."); toastMessage("Cannot decrease quantity below 0.", "error"); } } else { console.error(`Product with ID ${productID} not found in the cart.`); toastMessage(`Product with ID ${productID} not found in the cart.`, "error"); } }) .catch(error => { console.error('Error fetching cart:', error); toastMessage('Error fetching cart.', "error"); }); } // New function to delete a cart line item function deleteCartLineItem(cartId, lineItemId) { const deleteCartMutation = ` mutation DeleteCartLineItem($input: DeleteCartLineItemInput!) { cart { deleteCartLineItem(input: $input) { cart { entityId lineItems { physicalItems { entityId productEntityId quantity } } } } } } `; const variables = { input: { cartEntityId: cartId, // Pass the cart entity ID lineItemEntityId: lineItemId // Pass the line item entity ID } }; GraphQLCallCart(deleteCartMutation, variables) .then(data => { console.log('Cart item deleted successfully:', data); // Optionally, update the UI to reflect the deleted item }) .catch(error => console.error('Error deleting cart item:', error)); } // Function to update the cart line item quantity function updateCartLineItem(cartId, lineItemId, newQuantity, productEntityId) { const updateCartMutation = ` mutation UpdateCartLineItem($input: UpdateCartLineItemInput!) { cart { updateCartLineItem(input: $input) { cart { entityId } } } } `; // Prepare the variables object to match the required mutation structure const variables = { input: { cartEntityId: cartId.toString(), // Ensure the ID is a string lineItemEntityId: lineItemId.toString(), // Ensure the ID is a string data: { lineItem: { quantity: parseInt(newQuantity, 10), // Ensure quantity is an integer productEntityId: parseInt(productEntityId, 10) // Ensure productEntityId is provided and is an integer } } } }; // Debugging - logging the variables to check the structure console.log('Updating cart with:', JSON.stringify(variables, null, 2)); console.log('GraphQL Mutation:', updateCartMutation); GraphQLCallCart(updateCartMutation, variables) .then(data => { console.log('Cart updated successfully:', data); // Optionally, update the UI to reflect the new quantity }) .catch(error => { if (error.response) { console.error('Error Response:', error.response.data); } console.error('Error updating cart:', error); }); } // Function to remove a cart line item function removeCartLineItem(cartId, lineItemId) { const removeCartMutation = ` mutation RemoveCartLineItem($input: RemoveCartLineItemInput!) { cart { removeCartLineItem(input: $input) { cart { entityId lineItems { physicalItems { entityId productEntityId quantity } } } } } } `; const variables = { input: { cartEntityId: cartId, lineItemEntityId: lineItemId } }; GraphQLCallCart(removeCartMutation, variables) .then(data => { console.log('Cart item removed successfully:', data); // Optionally, update the UI to remove the item }) .catch(error => console.error('Error removing cart item:', error)); } /** * Disables a target element for a specified duration. * @param {HTMLElement} targetElement - The element to disable. * @param {number} duration - Duration in milliseconds to keep the element disabled. */ function deplayAddToCart(targetElement, duration = 750) { // Disable the target element targetElement.disabled = true; targetElement.classList.add('disabled'); // Optional: Add a class for visual feedback // Re-enable the target element after the specified duration setTimeout(() => { targetElement.disabled = false; targetElement.classList.remove('disabled'); // Remove the disabled styling }, duration); } /** * Ensures that the toast container exists in the DOM. * If it doesn't exist, create it and append to the body. */ function ensureToastContainer() { let toastContainer = document.getElementById('toast-container'); if (!toastContainer) { toastContainer = document.createElement('div'); toastContainer.id = 'toast-container'; document.body.appendChild(toastContainer); } } /** * Displays a toast notification. * @param {string} message - The message to display in the toast. * @param {string} type - The type of toast ('success', 'error', 'info'). Default is 'info'. * @param {number} duration - Duration in milliseconds the toast should be visible. Default is 3000ms. */ function toastMessage(message, type = 'info', duration = 3000) { // Ensure the toast container exists ensureToastContainer(); const toastContainer = document.getElementById('toast-container'); // Create the toast element const toast = document.createElement('div'); toast.classList.add('toast', type); // Add classes based on type for styling // Optional: Add an icon based on the toast type const icon = document.createElement('span'); icon.classList.add('icon'); switch (type) { case 'success': icon.innerHTML = '✓'; // Checkmark break; case 'error': icon.innerHTML = '⚠'; // Warning break; case 'info': default: icon.innerHTML = 'ℹ'; // Info break; } toast.appendChild(icon); // Add the message text const messageSpan = document.createElement('span'); messageSpan.classList.add('message'); messageSpan.innerText = message; toast.appendChild(messageSpan); // Append the toast to the container toastContainer.appendChild(toast); // Trigger reflow to enable CSS animations (if any) void toast.offsetWidth; // Forces a reflow, allowing CSS transitions to run // Add the 'show' class to make the toast visible toast.classList.add('show'); // Set a timeout to remove the toast after the specified duration setTimeout(() => { // Start hide animation by removing 'show' and adding 'hide' class toast.classList.remove('show'); toast.classList.add('hide'); // Remove the toast from the DOM after the hide animation completes // Assuming the hide animation duration is 500ms setTimeout(() => { toast.remove(); }, 500); // Adjust this value based on your CSS hide animation duration }, duration); } function increaseBtn(element, productID) { let cartQuantity = element.parentElement.querySelector('.cartQuantity'); let quantity = parseInt(cartQuantity.innerText.replace('x', '')); // Remove the 'x' before parsing the number // Update the displayed quantity in the UI cartQuantity.innerText = `${quantity + 1}x`; // Add to cart (adding 1 each time it's clicked) addtocartAPI(productID, 1); // Optionally reset hide timer (for any UI interaction) resetHideTimer(element.parentElement); // disable element deplayAddToCart(element); // Toats message toastMessage('Product added to cart', 'success'); } // Function to handle the decrease button click function decreaseBtn(element, productID) { let cartQuantity = element.parentElement.querySelector('.cartQuantity'); let quantity = parseInt(cartQuantity.innerText.replace('x', '')); // Remove 'x' and get the numeric value // Decrement the quantity but stop at 0 if (quantity > 0) { const newQuantity = quantity - 1; cartQuantity.innerText = `${newQuantity}x`; if (newQuantity === 0) { addtocartremove(productID, 1); // Call the remove function // Update the UI to reflect removal document.getElementById(`addtocartbtn-${productID}`).classList.remove('isopen'); document.getElementById(`addtocartbtnact-${productID}`).style.display = ""; } else { // Update the quantity in the cart addtocartremove(productID, 1); } } // Optionally reset hide timer (for any UI interaction) resetHideTimer(element.parentElement); } function showButtons(parentElement) { const increaseBtn = parentElement.querySelector('.increaseBtn'); const decreaseBtn = parentElement.querySelector('.decreaseBtn'); if (increaseBtn && decreaseBtn) { increaseBtn.style.display = 'inline-block'; decreaseBtn.style.display = 'inline-block'; } } function hideButtons(parentElement) { const increaseBtn = parentElement.querySelector('.increaseBtn'); const decreaseBtn = parentElement.querySelector('.decreaseBtn'); if (increaseBtn && decreaseBtn) { increaseBtn.style.display = 'none'; decreaseBtn.style.display = 'none'; } } function resetHideTimer(parentElement) { clearTimeout(parentElement.hideTimer); parentElement.hideTimer = setTimeout(() => { hideButtons(parentElement); }, 2500); // Adjust time if needed } /** * Fetches the current cart and updates the UI for each product based on its presence in the cart. */ /** * Fetches the current cart and updates the UI for each product based on its presence in the cart. */ function cartnumber() { const getCartQuery = ` query getCart { site { cart { entityId lineItems { physicalItems { productEntityId quantity } } } } } `; GraphQLCallCart(getCartQuery) .then(data => { const cart = data.data.site.cart; const cartItems = cart.lineItems.physicalItems; // Select all product containers on the page const productContainers = document.querySelectorAll('[id^="addtocartbtn-"]'); productContainers.forEach(container => { // Extract productID from the container's ID (e.g., "addtocartbtn-99933" => "99933") const containerId = container.id; const productID = containerId.split('-')[1]; // Check if the productID exists in the cart const cartItem = cartItems.find(item => item.productEntityId.toString() === productID.toString()); if (cartItem) { const quantity = cartItem.quantity; // Update the quantity display const quantityElement = container.querySelector('.cartQuantity'); if (quantityElement) { quantityElement.innerText = `${quantity}x`; } else { console.warn(`.cartQuantity element not found in ${containerId}.`); } // Handle the open state by adding the 'isopen' class container.classList.add('isopen'); // Hide the decrease and increase buttons initially const decreaseBtn = container.querySelector('.decreaseBtn'); const increaseBtn = container.querySelector('.increaseBtn'); if (decreaseBtn && increaseBtn) { decreaseBtn.style.display = 'none'; increaseBtn.style.display = 'none'; } // Hide the 'Add To Cart' button const addToCartBtn = document.getElementById(`addtocartbtnact-${productID}`); if (addToCartBtn) { addToCartBtn.style.display = 'none'; } // Ensure hover event listeners are attached (in case they aren't) attachHoverEvents(container, productID); } else { } }); }) .catch(error => { console.error('Error fetching cart:', error); }); } /** * Attaches hover event listeners to a product container to show/hide buttons. * @param {HTMLElement} container - The product container element. * @param {number|string} productID - The ID of the product. */ function attachHoverEvents(container, productID) { // Ensure that event listeners are not attached multiple times if (!container.hasAttribute('data-hover-attached')) { container.addEventListener('mouseenter', () => { console.log(`Mouse entered container for product ID ${productID}`); showButtons(container); }); container.addEventListener('mouseleave', () => { console.log(`Mouse left container for product ID ${productID}`); resetHideTimer(container); }); // Mark the container as having hover events attached container.setAttribute('data-hover-attached', 'true'); } } function addToCart(element, productID) { console.log('Add to Cart'); element.style.display = 'none'; document.getElementById(`addtocartbtn-${productID}`).classList.add('isopen'); // Mouse enter to show the buttons document.getElementById(`addtocartbtn-${productID}`).addEventListener('mouseenter', () => { let parentElement = document.getElementById(`addtocartbtn-${productID}`); console.log('Mouse entered parent element'); showButtons(parentElement); }); // Mouse leave to hide the buttons after the timer document.getElementById(`addtocartbtn-${productID}`).addEventListener('mouseleave', () => { let parentElement = document.getElementById(`addtocartbtn-${productID}`); console.log('Mouse left parent element'); resetHideTimer(parentElement); }); } document.getElementById("searchPLP").addEventListener("keydown", function(event) { if (event.key === "Enter") { event.preventDefault(); // Prevent the default form submission behavior searchURlappend(); // Call your function } }); // Add an event listener for the icon button document.getElementById("iconButton").addEventListener("click", function() { const searchTermElement = document.getElementById("searchPLP"); const iconButtonElement = document.getElementById("iconButton"); const url = new URL(window.location.href); const searchTermFromURL = url.searchParams.get('searchTerm'); const searchTermValue = searchTermElement.value; // If the icon is acting as a clear button, clear the search and reset if (iconButtonElement.classList.contains('clear')) { searchTermElement.value = ''; // Clear the input field url.searchParams.delete('searchTerm'); window.history.replaceState({}, '', url); iconButtonElement.classList.remove('clear'); updateIconButton(); // Update the icon appearance location.reload(); } else { searchURlappend(); // Otherwise, proceed with search functionality } }); // Function to dynamically update the icon based on input changes document.getElementById("searchPLP").addEventListener("input", function() { updateIconButton(); }); function searchURlappend() { const url = new URL(window.location.href); const searchTermElement = document.getElementById("searchPLP"); const searchTermFromURL = url.searchParams.get('searchTerm'); const searchTermValue = searchTermElement.value; if (searchTermFromURL && !searchTermValue) { searchTermElement.value = searchTermFromURL; build(); } else if (searchTermValue && !searchTermFromURL) { url.searchParams.set('searchTerm', searchTermValue); window.history.replaceState({}, '', url); build(); } else if (searchTermValue && searchTermFromURL && searchTermValue !== searchTermFromURL) { url.searchParams.set('searchTerm', searchTermValue); window.history.replaceState({}, '', url); build(); } updateIconButton(); // Update the icon after searching } // Function to update the icon based on the state function updateIconButton() { const searchTermElement = document.getElementById("searchPLP"); const iconButtonElement = document.getElementById("iconButton"); const url = new URL(window.location.href); const searchTermFromURL = url.searchParams.get('searchTerm'); const searchTermValue = searchTermElement.value; if (searchTermValue && searchTermValue === searchTermFromURL) { // If the search term in the URL matches the input value, show the clear icon iconButtonElement.classList.add('clear'); } else { // Otherwise, show the search icon iconButtonElement.classList.remove('clear'); } } // Initialize the icon state when the page loads document.addEventListener("DOMContentLoaded", function() { updateIconButton(); }); // Ordering Functions function runAfter(){ try { document.getElementById('sort').addEventListener('change', build); document.getElementById('applyButtonPriceSearch').addEventListener('click', build); document.getElementById('perPageSelect').addEventListener('change', build); searchURlappend() updateIconButton(); // seeMoreFacets() //fetchAndMergeFacetData(); try { cartnumber(); } catch (error) { } function handleFilterEvent(event) { if (isEventHandled) return; if (event.target.classList.contains('filter')) { const filterValue = event.target.dataset.facetvalue; const filterName = event.target.dataset.facetname; removeFilter(filterName, filterValue); } isEventHandled = true; setTimeout(() => { isEventHandled = false; }, 500); // Reset the flag after 500 ms } const appliedFiltersElement = document.querySelector('.appliedFilters'); appliedFiltersElement.addEventListener('click', handleFilterEvent); appliedFiltersElement.addEventListener('touchend', handleFilterEvent); } catch (error) { console.log('error in runAfter addEventListener', error) } onPopStateHandler((state) => { if (state) { //console.log('State changed:', state); } }); // activeFilters = getActiveFacetsFromURL(); // document.querySelector('.appliedFilters').addEventListener('click', function(event) { // if (event.target.classList.contains('filter')) { // const filterValue = event.target.textContent; // const filterName = event.target.dataset.facetname; // removeFilter(filterName, filterValue); // } // }); customFieldsCollection(); // addtocartListener(); getWishlist(); AddtoWishlist(); try { let checkboxes = document.querySelectorAll('.selectionFilter input[data-filtername]'); checkboxes.forEach(checkbox => { checkbox.addEventListener('change', function(event) { const filterName = event.target.getAttribute('data-filtername'); //console.log(filterName); updateActiveFilters(filterName, event.target.id, event.target.checked); sortByUrlUpdate() // updatePriceRangeURL() build(1); updateURLWithFacets(); clearPriceFilters() }); }); // 1. Set the innerHTML of the .accordion__price container with price filter radio buttons document.querySelector('.accordion__price').innerHTML = ` <div data-key="price" data-value="P0-25_dollars" class="selectionFilter"> <input class="price-filter" data-qureyname="price" data-qureyvalue_name="$00.00—$25.00" type="radio" id="P0-25_dollars" name="price-filter"> <label for="P0-25_dollars"> $00.00 - $25.00 </label> </div> <div data-key="price" data-value="P25-50_dollars" class="selectionFilter"> <input class="price-filter" data-qureyname="price" data-qureyvalue_name="$25.00—$50.00" type="radio" id="P25-50_dollars" name="price-filter"> <label for="P25-50_dollars"> $25.00 - $50.00 </label> </div> <div data-key="price" data-value="P50-75_dollars" class="selectionFilter"> <input class="price-filter" data-qureyname="price" data-qureyvalue_name="$50.00—$75.00" type="radio" id="P50-75_dollars" name="price-filter"> <label for="P50-75_dollars"> $50.00 - $75.00 </label> </div> <div data-key="price" data-value="P75-100_dollars" class="selectionFilter"> <input class="price-filter" data-qureyname="price" data-qureyvalue_name="$75.00—$100.00" type="radio" id="P75-100_dollars" name="price-filter"> <label for="P75-100_dollars"> $75.00 - $100.00</label> </div> <div data-key="price" data-value="P100-900_dollars" class="selectionFilter"> <input class="price-filter" data-qureyname="price" data-qureyvalue_name="$100.00+" type="radio" id="P100-900_dollars" name="price-filter"> <label for="P100-900_dollars"> $100.00+ </label> </div> <!-- Add a button to clear the price filters --> <div class="selectionFilter"> <button id="clear-price-filters">Clear Price</button> </div> `; // 2. Function to parse URL parameters and extract minPrice and maxPrice function getPriceFiltersFromURL() { const urlParams = new URLSearchParams(window.location.search); const minPriceParam = urlParams.get('minPrice'); const maxPriceParam = urlParams.get('maxPrice'); // Parse as floats; if not present, set to null const minPrice = minPriceParam !== null ? parseFloat(minPriceParam) : null; const maxPrice = maxPriceParam !== null ? parseFloat(maxPriceParam) : null; return { minPrice, maxPrice }; } // 3. Function to set the checked state of price filter radio buttons based on URL parameters function setPriceRadioButtons() { const { minPrice, maxPrice } = getPriceFiltersFromURL(); const radios = document.querySelectorAll('.accordion__price input[data-qureyname="price"]'); radios.forEach(radio => { const queryValueName = radio.getAttribute('data-qureyvalue_name'); let min = 0; let max = 0; if (queryValueName.endsWith('+')) { // Handle cases like "$100.00+" min = parseFloat(queryValueName.replace(/\$([0-9.]+)\+/, '$1')); max = 9999; } else { // Handle cases like "$25.00—$50.00" const matches = queryValueName.match(/\$([0-9.]+)[—-]\$?([0-9.]*)/); if (matches) { min = parseFloat(matches[1]); max = parseFloat(matches[2]) || 9999; // Use Infinity if no upper bound is specified } } // Determine if the radio button should be checked if (!isNaN(min) && !isNaN(max)) { if (minPrice !== null && maxPrice !== null) { if (min >= minPrice && max <= maxPrice) { radio.checked = true; } else { radio.checked = false; } } else if (minPrice !== null && maxPrice === null) { if (min >= minPrice) { radio.checked = true; } else { radio.checked = false; } } else if (minPrice === null && maxPrice !== null) { if (max <= maxPrice) { radio.checked = true; } else { radio.checked = false; } } else { radio.checked = false; } } else { radio.checked = false; } }); } // 4. Call the function to set radio buttons based on the current URL setPriceRadioButtons(); // 5. Function to handle radio button changes function handlePriceRadioChange(event) { const radio = event.target; const filterName = radio.getAttribute('data-qureyname'); const filterValueName = radio.getAttribute('data-qureyvalue_name'); const isChecked = radio.checked; console.log(`Filter Changed: ${filterName} = ${filterValueName}, Checked: ${isChecked}`); updateActiveQuery(filterName, filterValueName, isChecked); build(1); } // 6. Attach event listeners to all price filter radio buttons let radios_qureyname = document.querySelectorAll('.selectionFilter input[data-qureyname]'); radios_qureyname.forEach(radio => { radio.addEventListener('change', handlePriceRadioChange); }); // 7. Function to clear the price filters from the URL and inputs function clearPriceFilters() { const urlParams = new URLSearchParams(window.location.search); urlParams.delete('minPrice'); urlParams.delete('maxPrice'); // Update the URL without reloading the page const newUrl = `${window.location.pathname}?${urlParams.toString()}`; window.history.replaceState(null, '', newUrl); // Uncheck all radio buttons const radios = document.querySelectorAll('.accordion__price input[data-qureyname="price"]'); radios.forEach(radio => { radio.checked = false; }); // Ensure the URL and inputs are synced up with the updated state updateActiveQuery('price', null, false); // Call build to update the view build(1); } // 8. Attach event listener to the clear filters button document.getElementById('clear-price-filters').addEventListener('click', clearPriceFilters); } catch(err){console.log(err)} } function build(page = 1, afterArgument = '', MoreProducts = '') { currentPage = page; // Update the current page let productAttributes; productAttributes = activeFilters.length > 0 ? activeFilters : []; //console.log("build called with page:", page); appliedFilters(activeFilters); breadcrumbsBuild(activeFilters) console.log('runs more than once') // console.log(QureyBuilt(productAttributes, afterArgument)) GraphQLCall(QureyBuilt(productAttributes, afterArgument)) .then(data => { if(MoreProducts == '#MoreProducts' || MoreProducts == '#startMoreProducts'){ } else{ document.querySelectorAll('.productGridFacets')[0].innerHTML = ""; document.querySelector('#MoreProducts').innerHTML = ""; } rawData = data; collectionInfo = data.data.site.search.searchProducts.products.collectionInfo; pageInfo = data.data.site.search.searchProducts.products.pageInfo; cursors[currentPage - 1] = pageInfo.startCursor; DefaultFilters = data.data.site.search.searchProducts.filters.edges plpProducts = data.data.site.search.searchProducts.products.edges; const productsCategory = JSON.stringify(data); if(plpProducts == []){ let listedDocuments = document.querySelector('.productGridFacets'); listedDocuments.insertAdjacentHTML('beforeend', ` <p>Nothing Found</p> `) } pageCountTotal(); buildProducts(plpProducts, MoreProducts); fetchAndBuildProductAttributes(); try { handleSelectionFilterClick(); } catch (error) { } }) .catch(error => { console.error("Failed to Build Products Page Review Build Function", error); }); } function onPopStateHandler(callback) { window.addEventListener('popstate', (event) => { const state = event.state; callback(state); }); } window.history.replaceState({}, '', window.location.href.replace(/[?&](_bc_fsnf|in_stock)=[^&]*/gi,'')); sortByUrlUpdate() updatePriceRangeURL() build(1) function closeModal(modal, modalContainer) { if (modal && modalContainer && !modal.classList.contains('Mobilehide')) { modal.classList.add('Mobilehide'); modalContainer.style.bottom = '0px'; modalContainer.style.transition = 'bottom 0.3s ease'; //console.log('Modal closed'); } } function setupModal(modalSelector, containerSelector) { const modal = document.querySelector(modalSelector); const modalContainer = document.querySelector(containerSelector); let startY; if(!modal || !modalContainer) { //console.log('Modal or modalContainer not found'); return; } modal.addEventListener('click', function(e) { //if (e.target === modal && !e.target.closest('.modalMobileContainer')) { if (e.target === modal && !e.target.closest(containerSelector)) { closeModal(modal, modalContainer); //console.log('Modal clicked'); } }); modalContainer.addEventListener('touchstart', function(e) { if (!e.target.closest('.contentDetails')) { startY = e.touches[0].clientY; modalContainer.style.transition = 'none'; } }, { passive: false }); modalContainer.addEventListener('touchmove', function(e) { if (!e.target.closest('.contentDetails')) { const touch = e.touches[0]; const change = touch.clientY - startY; const newBottom = -change; modalContainer.style.bottom = `${newBottom}px`; e.preventDefault(); } }, { passive: false }); modalContainer.addEventListener('touchend', function(e) { if (!e.target.closest('.contentDetails')) { if (parseInt(modalContainer.style.bottom, 10) < -225) { closeModal(modal, modalContainer); //console.log('Modal clicked'); } else { modalContainer.style.transition = 'bottom 0.3s ease'; modalContainer.style.bottom = '0px'; } } }); } //setupModal('.modalMobileFilters', '.modalMobileContainerFilters'); setupModal('.modalMobile.wishlistProduct', '.modalMobile.wishlistProduct .modalMobileContainer'); /* */ // Wishlist Form Functions document.addEventListener("DOMContentLoaded", function() { var existingWishlist = document.getElementById("existingWishlistGroup"); var buttonCreateNew = document.getElementById("createNewBtn"); var buttonUseExisting = document.getElementById("useExistingBtn"); var NewWishlist = document.getElementById("newWishlistGroup"); buttonCreateNew.addEventListener("click", function() { existingWishlist.classList.add("hide"); NewWishlist.classList.remove("hide"); }); buttonUseExisting.addEventListener("click", function() { NewWishlist.classList.add("hide"); existingWishlist.classList.remove("hide"); }); useExistingBtn.addEventListener("click", function() { // Submit the selected existing wishlist const selectedWishlist = document.getElementById("existingWishlist").value; // console.log("Using existing wishlist: " + selectedWishlist); }); createNewBtn.addEventListener("click", function() { // Submit the new wishlist const newWishlist = document.getElementById("newWishlist").value; // console.log("Creating new wishlist: " + newWishlist); }); }); seeNextPage(); let debounceTimer; let waitLoading = false; function checkScrollPosition() { if (document.querySelector('.productCategoies').offsetHeight / window.pageYOffset < 1.7) { if (waitLoading) return; seeNextPage(); waitLoading = true; setTimeout(() => { waitLoading = false; }, 500); } } window.addEventListener('scroll', checkScrollPosition); // Adjust 200 ms to your preference const pageName = window.location.pathname; // Assuming '/shop-by/kitchen' or '/shop-by/home' let currentCursorPage = new URL(window.location.href).searchParams.get('endCursor'); // Initialize to null function saveStateToLocalStorage(newSavedCursors) { const savedCursors = loadStateFromLocalStorage() || []; const mergedCursors = [...savedCursors, ...newSavedCursors]; const uniqueMergedCursors = [...new Set(mergedCursors)]; localStorage.setItem(`cursors_${pageName}`, JSON.stringify(uniqueMergedCursors)); } function loadStateFromLocalStorage() { const savedCursors = localStorage.getItem(`cursors_${pageName}`); return savedCursors ? JSON.parse(savedCursors) : []; } // Update URL when changing pages function updateURL(endCursor) { const url = new URL(window.location.href); url.searchParams.set('endCursor', endCursor); window.history.replaceState({}, '', url); } let savedCurrentCursorForNextCall = new URL(window.location.href).searchParams.get('endCursor');; function seeNextPage() { if (pageInfo.hasNextPage) { if (savedCurrentCursorForNextCall && savedCurrentCursorForNextCall === pageInfo.endCursor) { console.log('Already fetched this page:', pageInfo.endCursor); return; } let savedCursors = loadStateFromLocalStorage(); savedCursors.push(pageInfo.endCursor); const afterArg = `, after: "${pageInfo.endCursor}"`; build(currentPage = 1, afterArg, '#MoreProducts'); currentCursorPage = pageInfo.endCursor; console.log('Current Cursor:', currentCursorPage); updateURL(currentCursorPage); saveStateToLocalStorage(savedCursors); savedCurrentCursorForNextCall = pageInfo.endCursor; } } // See previous page function seePreviousPage() { let savedCursors = loadStateFromLocalStorage(); const currentIndex = savedCursors.indexOf(currentCursorPage); if (currentIndex > 0) { const previousCursor = savedCursors[currentIndex - 1]; const afterArg = `, after: "${previousCursor}"`; build(currentPage = 1, afterArg, '#startMoreProducts'); currentCursorPage = previousCursor; updateURL(currentCursorPage); saveStateToLocalStorage(savedCursors); } else { const afterArg = `, after: ""`; build(currentPage = 1, afterArg, '#startMoreProducts'); updateURL(""); localStorage.removeItem(`cursors_${pageName}`); document.querySelector('.previousProducts').remove() //console.log("No previous cursor available."); } } </script> <style>.xnpe_async_hide{opacity:0 !important}</style> <style> /* PLP Category Buttons */ .subCategoryParent { /* display: flex; */ width: 100% !important; min-width: unset; clear: both; padding: 0px 50px ; max-width: 1280px; margin: 0px auto; } .subCategoryParent .subCategory .CategoryBTN { transition: all 0.15s ease; background-color: #2b2b2b; height: 100px; width: 125px; margin: 10px auto 10px auto; border-radius: 5px; overflow: hidden; position: relative; } .subCategoryParent .subCategory .CategoryBTN img{ position: absolute; margin: auto; left: 0; right: 0; top: 0; bottom: 0; text-align: center; display: block; } .subCategoryParent .subCategory a { text-decoration: none; } .subCategoryParent .subCategory a p::after { transition: all 0.5s ease; height: 2px; width: 0px; content: ""; margin: 6px auto 0px auto; display: block; border-radius: 5px; background-color: #425563; } .subCategoryParent .subCategory a:hover p::after { transition: all 0.5s ease; height: 3px; width: 60px; content: ""; margin: 6px auto 0px auto; display: block; border-radius: 5px; background-color: #425563; } /* for mobile */ .pillBTN-PLP-Parent { margin: 20px 0px 0px 0px; } .pillBTN-PLP { background: #eee; width: 150px; border-radius: 7px; font-weight: bold; display: inline-block; margin: 0px 10px !important; } .pillBTN-PLP p { padding: 10px 0px; font-weight: bold; margin: 0px 15px !important; } #mobileCategory .slick-slide { margin: 0px 10px; } /* Bootstrap */ /* End of Bootstrap */ @media (max-width: 1200px) { .subCategoryParent, .subCategoryParent.slick-slider, #desktopCategory{ display: none !important; } } </style> <!-- <div class="pillBTN-PLP-Parent bootstrap d-xl-none d-lg-block slick-initialized slick-slider" id="mobileCategory" style=""> <div class="slick-list draggable"> <div class="slick-track" style="opacity: 1; width: 70000px; transform: translate3d(-10px, 0px, 0px);"> <div aria-hidden="false" class="slick-slide slick-current slick-active" data-slick-index="0"> <div> <div class="pillBTN-PLP" style="width: 100%; display: inline-block;"> <p><a href="https://www.demdaco.com/shop-by/home-living/oil-diffusers/" style="text-decoration: none;" tabindex="0">Oil Diffusers</a></p> </div> </div> </div> </div> </div> </div> --> <script> let slideIndex = 0; let imageList = [] /* <div> <div class="subCategory" style="width: 100%;"> <a href="#"> <div class="CategoryBTN"> <img src="https://cdn11.bigcommerce.com/s-kmr73o5t54/images/stencil/original/image-manager/tbn-homeliving-copy-1.jpg?t=1661377404" alt="Oil Diffuser "> </div> <p>${key}</p> </a> </div> </div> */ // let ClassSlider = [] // $(document).ready(function() { // var checkExist = setInterval(function() { // let ClassSlider = document.querySelector(".subCategoryParent"); // // console.log("Checking for ClassSlider: ", ClassSlider); // if (ClassSlider !== null) { // // console.log("Found ClassSlider, initializing slick..."); // try { // $('.pillBTN-PLP-Parent').slick('unslick'); // $('.pillBTN-PLP-Parent').slick({ // infinite: true, // slidesToShow: 3, // slidesToScroll: 1, // dots: false, // arrows: false, // variableWidth: true, // edgeFriction: true, // draggable: true, // infinite: false // }); // $(ClassSlider).slick('unslick'); // $(ClassSlider).slick({ // infinite: true, // slidesToShow: 7, // slidesToScroll: 1, // responsive: [ // { // breakpoint: 1280, // settings: { // slidesToShow: 5, // slidesToScroll: 1, // infinite: false // } // }, // { // breakpoint: 1024, // settings: { // slidesToShow: 4, // slidesToScroll: 1, // } // }, // { // breakpoint: 900, // settings: { // slidesToShow: 3, // slidesToScroll: 1, // infinite: false // } // }, // { // breakpoint: 480, // settings: { // slidesToShow: 1, // slidesToScroll: 1, // infinite: false // } // } // // You can unslick at a given breakpoint now by adding: // // settings: "unslick" // // instead of a settings object // ] // }); // // let imageList = [{'apparel': 'image.jpg'},{'baby': 'imageother.jpg'} ] // addClassObject(mergedFilters.find(obj => 'Class' in obj), imageList) // clearInterval(checkExist); // } catch (e) { // // console.error("Error initializing slick: ", e); // } // } // }, 100); // }); </script> <script> function updateCanonicalURL() { // Get the current URL let url = new URL(window.location.href); // Extract relevant information from the URL let pathSegments = url.pathname.split('/').filter(segment => segment); // Initialize the canonical URL let canonicalURL = url.origin + '/' + pathSegments.slice(0, 1).join('/'); // Check the number of facets in the URL (each facet is a pair of path segments) let numberOfFacets = Math.floor((pathSegments.length - 1) / 2); // Initialize meta robots element let metaRobotsElement = document.querySelector('meta[name="robots"]'); if (numberOfFacets <= 3) { // Use the current URL as the canonical URL, but remove any query parameters canonicalURL = url.pathname; // Remove noindex if it exists if (metaRobotsElement) { metaRobotsElement.parentNode.removeChild(metaRobotsElement); } } else { // Use only the first 3 facets for the canonical URL canonicalURL = '/' + pathSegments.slice(0, 1 + 3 * 2).join('/'); // Add noindex meta tag if (!metaRobotsElement) { metaRobotsElement = document.createElement('meta'); metaRobotsElement.setAttribute('name', 'robots'); metaRobotsElement.setAttribute('content', 'noindex'); document.head.appendChild(metaRobotsElement); } } if (canonicalURL.endsWith('/')) { canonicalURL = canonicalURL.slice(0, -1); } let canonicalElement = document.querySelector('link[rel="canonical"]'); if (!canonicalElement) { canonicalElement = document.createElement('link'); canonicalElement.setAttribute('rel', 'canonical'); document.head.appendChild(canonicalElement); } canonicalElement.setAttribute('href', canonicalURL); // Update the inner HTML of the paragraph element with class "CanonicalTitle" setTimeout(() => { // document.querySelector('.CanonicalTitle').innerHTML = canonicalURL; }, 1000); } function updatePageTitle() { // Get the current URL and its parameters const url = new URL(window.location.href); const params = new URLSearchParams(url.search); // Extract relevant information from the URL const pathSegments = url.pathname.split('/').filter(segment => segment); // Initialize variables for title components let formatOrKeyAttributeLead = ""; let values = []; // Populate the title components based on the URL if (pathSegments.length > 2) { formatOrKeyAttributeLead = pathSegments[2].charAt(0).toUpperCase() + pathSegments[2].slice(1); } const additionalFormats = params.get('Additionalformat'); if (additionalFormats) { values = additionalFormats.split(':').map(value => value.charAt(0).toUpperCase() + value.slice(1)); } // Create the title string based on the number of additional formats let titleValues = ""; if (values.length === 2) { titleValues = values.join(' & '); } else if (values.length === 3) { titleValues = `${values[0]}, ${values[1]} & ${values[2]}`; } else if (values.length > 3) { titleValues = `${values.slice(0, -1).join(', ')}, & More`; } else { titleValues = values.join(', '); } const title = formatOrKeyAttributeLead ? `${formatOrKeyAttributeLead}, ${titleValues} | DEMDACO` : "Shop By | DEMDACO"; document.title = title; } function updatePageh1Title() { let titleValues = []; // Flatten the array and filter out 'Yes' or 'No' activeFilters.forEach(filters => { filters.value.forEach(val => { if (val.toLowerCase() !== 'yes' && val.toLowerCase() !== 'Y' && val.toLowerCase() !== 'N' && val.toLowerCase() !== 'no' && val.toLowerCase() !== 'female' && val.toLowerCase() !== 'male' && val.toLowerCase() !== 'unisex') { titleValues.push(val); } }); }); let Pagetitle; if (titleValues.length > 0) { // Filter out 'Y' from titleValues const filteredTitles = titleValues.filter(title => title !== 'Y'); if (filteredTitles.length === 2) { Pagetitle = filteredTitles.join(' & '); } else if (filteredTitles.length === 3) { Pagetitle = `${filteredTitles[0]}, ${filteredTitles[1]} & ${filteredTitles[2]}`; } else if (filteredTitles.length > 3) { Pagetitle = `${filteredTitles.slice(0, 3).join(', ')} & More`; } else { Pagetitle = filteredTitles.join(', '); } } else { Pagetitle = "Shop All DEMDACO"; } //console.log(Pagetitle); let h1Title = Pagetitle setTimeout(() => { let headingTitleElement = document.querySelector('h1'); if (headingTitleElement) { headingTitleElement.innerHTML = formatFacetValue(h1Title); } }, 700); } function updatekeywords() { // Get the current URL and its parameters const url = new URL(window.location.href); const params = new URLSearchParams(url.search); // Extract relevant information from the URL const pathSegments = url.pathname.split('/').filter(segment => segment); // Initialize variables for title components let formatOrKeyAttributeLead = ""; let values = []; // Populate the title components based on the URL if (pathSegments.length > 2) { formatOrKeyAttributeLead = pathSegments[2].charAt(0).toUpperCase() + pathSegments[2].slice(1); } const additionalFormats = params.get('Additionalformat'); if (additionalFormats) { values = additionalFormats.split(':').map(value => value.charAt(0).toUpperCase() + value.slice(1)); } // Create the title string based on the number of additional formats let titleValues = ""; if (values.length === 2) { titleValues = values.join(' & '); } else if (values.length === 3) { titleValues = `${values[0]}, ${values[1]} & ${values[2]}`; } else if (values.length > 3) { titleValues = `${values.slice(0, -1).join(', ')}, & More`; } else { titleValues = values.join(', '); } let keywordsElement = document.querySelector('meta[name="keywords"]'); if (!keywordsElement) { keywordsElement = document.createElement('meta'); keywordsElement.setAttribute('name', 'keywords'); document.head.appendChild(keywordsElement); } keywordsElement.setAttribute('content', titleValues); } function updateMetadescription() { // Get the current URL and its parameters const url = new URL(window.location.href); const params = new URLSearchParams(url.search); // Extract relevant information from the URL const pathSegments = url.pathname.split('/').filter(segment => segment); // Initialize variables for title components let formatOrKeyAttributeLead = ""; let values = []; // Populate the title components based on the URL if (pathSegments.length > 2) { formatOrKeyAttributeLead = pathSegments[2].charAt(0).toUpperCase() + pathSegments[2].slice(1); } const additionalFormats = params.get('Additionalformat'); if (additionalFormats) { values = additionalFormats.split(':').map(value => value.charAt(0).toUpperCase() + value.slice(1)); } // Create the title string based on the number of additional formats let titleValues = ""; if (values.length === 2) { titleValues = values.join(' & '); } else if (values.length === 3) { titleValues = `${values[0]}, ${values[1]} & ${values[2]}`; } else if (values.length > 3) { titleValues = `${values.slice(0, -1).join(', ')}, & More`; } else { titleValues = values.join(', '); } let descriptionElement = document.querySelector('meta[name="description"]'); if (!descriptionElement) { descriptionElement = document.createElement('meta'); descriptionElement.setAttribute('name', 'description'); document.head.appendChild(descriptionElement); } descriptionElement.setAttribute('content', titleValues + "We at DEMDACO believe every product creates a conversation."); } function getSeoData() { try{ let jsonDataElement = document.getElementById('seoData'); let jsonSEOData = JSON.parse(jsonDataElement.textContent || jsonDataElement.innerText); if (jsonSEOData.page_title) { document.title = jsonSEOData.page_title; } else { updatePageTitle() } if (jsonSEOData.canonical) { let canonicalElement = document.querySelector('link[rel="canonical"]'); if (!canonicalElement) { canonicalElement = document.createElement('link'); canonicalElement.setAttribute('rel', 'canonical'); document.head.appendChild(canonicalElement); } canonicalElement.setAttribute('href', jsonSEOData.canonical); } else { updateCanonicalURL() } if (jsonSEOData.description) { let descriptionElement = document.querySelector('meta[name="description"]'); if (!descriptionElement) { descriptionElement = document.createElement('meta'); descriptionElement.setAttribute('name', 'description'); document.head.appendChild(descriptionElement); } descriptionElement.setAttribute('content', jsonSEOData.description); } else { updateMetadescription() } if (jsonSEOData.keywords) { let keywordsElement = document.querySelector('meta[name="keywords"]'); if (!keywordsElement) { keywordsElement = document.createElement('meta'); keywordsElement.setAttribute('name', 'keywords'); document.head.appendChild(keywordsElement); } keywordsElement.setAttribute('content', jsonSEOData.keywords); } else { updatekeywords() } }catch(err) { ; } } function updateBanner() { try { let jsonDataElement = document.getElementById('bannerContent'); let jsonSEOData = JSON.parse(jsonDataElement.textContent || jsonDataElement.innerText); if (jsonSEOData.h1) { } else { updatePageh1Title() } } catch(err) { ; } } function itemID() { var path = window.location.pathname; // Ensure there's a trailing slash if (!path.endsWith('/')) { path += '/'; } // Now, replace slashes and return the modified path return path.replace(/^\//, '').replace(/\/$/, '').replace(/\//g, '_'); } function weblayer(URLWebID, layerID, callback){ // accessible in the web layer as exponea.showWebLayer( layerID, { rowID: URLWebID + "", placement: "contentWeblayer" }, true, function(){ if (typeof callback === 'function') { callback(); } } ); } // Need this for buy with prime this needs to be optimized to not need polling document.addEventListener('DOMContentLoaded', function () { // Function to run when the modal closes function onModalClose() { bwpCartScriptLoadedOn = ""; console.log('Modal closed and script executed'); } // Function to add modal event listeners function addModalEventListeners() { // Attach event listener to elements with the class 'modal-background' var modalBackgrounds = document.querySelectorAll('.modal-background'); modalBackgrounds.forEach(function (background) { background.addEventListener('click', onModalClose); }); // Attach event listener to elements with the class 'modal-close' var modalCloseButtons = document.querySelectorAll('.modal-close'); modalCloseButtons.forEach(function (button) { button.addEventListener('click', onModalClose); }); // Attach event listener for the Escape key document.addEventListener('keydown', function (event) { if (event.key === 'Escape') { onModalClose(); } }); } // Function to add quickview button event listeners function addQuickviewButtonListeners() { var quickviewButtons = document.querySelectorAll('.button.button--small.card-figcaption-button.quickview'); quickviewButtons.forEach(function (button) { if (!button.hasAttribute('data-listener-added')) { button.addEventListener('click', function () { addModalEventListeners(); }); button.setAttribute('data-listener-added', 'true'); // Mark this button to avoid adding the listener multiple times } }); } // Polling function to check for new quickview buttons function pollForQuickviewButtons() { addQuickviewButtonListeners(); setTimeout(pollForQuickviewButtons, 300); // Check every second } // Start polling pollForQuickviewButtons(); }); window.addEventListener('popstate', function(event) { location.reload(); }); </script>