Women's Sweatpants & Joggers Sale (2024)

${productsMarkup}

`; }, collapseButtonText: ({ collapsed }) => collapsed ? "+" : "-", }, cssClasses: { root: "refinement-group__panel--root", body: "refinement-group__panel", header: "refinement-group__panel--header", collapsedRoot: "refinement-group__collapsed", collapseButton: "refinement-group__panel--collapse custom-collapse" } })(instantsearch.widgets.refinementList); cache.client.addWidget(panel({ container: filterContainerIds[filter.id], attribute: filter.attributeName, sortBy: [filter.sortBy], limit: filter.limit || 24, showMore: true, showMoreLimit: 100, templates: { item: (item) => { if(DynamicYield) { if(item.isRefined && document.querySelector(`[data-filter-value="${item.value}"]`)) { if(selected_filters.indexOf(item.value) == -1) { selected_filters.push(item.value); var type = document.querySelector(`[data-filter-value="${item.value}"]`).getAttribute("data-filter-attribute"); DynamicYield.filterItems(type, item.value); } } else if(selected_filters.indexOf(item.value) > -1) { selected_filters.splice(selected_filters.indexOf(item.value), 1); } } if (filter.isColour) { return ` `; } else if (filter.isSize) { return ` `; } else if (filter.isPrice) { return ` `; } else if (filter.isBrand) { return ` `; } else if (filter.id === 'named_tags_Discount Amount') { return ` ` } else { return ` ` } }, }, cssClasses: { root: "refinement-group", body: "refinement-group__body", list: "refinement-group__body", footer: "refinement-group__footer", item: "refinement-group__item", selectedItem: "refinement-group__item--active", disabledShowMore: "hidden" }, transformItems(items) { if (filter.isColour) { items = items.filter((item) => item.value.toLowerCase() !== "n/a"); } if (filter.isPrice) { return formatPriceRefinements(items); } else if (filter.isSize) { return formatSizeRefinements(items); } else if (filter.sortBy === "name:asc") { return sortRefinementsAlphabetically(items, true); } else if (filter.sortBy === "name:desc") { return sortRefinementsAlphabetically(items, false); } return items; } })); }); var matches = window.location.pathname.match(/\/collections\/([^/]+)/i); collectionHandle = Boolean(matches) && matches.length === 2 ? matches[1] : null; let collectionFacetFilter; /*if (algolia.config.collection_id_indexing) { collectionFacetFilter = algolia.current_collection_id ? 'collection_ids:"' + algolia.current_collection_id + '"' : null; } else {*/ collectionFacetFilter = collectionHandle ? 'collections:"' + collectionHandle + '"' : null; //} if(collectionFacetFilter) { // Add the collection filter to the list of search filters searchFilters.push(collectionFacetFilter); } const collectionRulesContextValue = algolia.config.collection_id_query_rules ? algolia.current_collection_id : collectionHandle; const analyticsTags = collectionRulesContextValue ? [collectionRulesContextValue] : []; if(window.location.pathname === '/search') { analyticsTags.push('search'); } else { analyticsTags.push('collection'); } const getDeviceType = () => { const ua = navigator.userAgent; if (/(tablet|ipad|playbook|silk)|(android(?!.*mobi))/i.test(ua)) { return "tablet"; } if ( /Mobile|iP(hone|od)|Android|BlackBerry|IEMobile|Kindle|Silk-Accelerated|(hpw|web)OS|Opera M(obi|ini)/.test( ua ) ) { return "mobile"; } return "desktop"; }; analyticsTags.push(getDeviceType()); // Filters for stock policy var stockPolicyFilter = null; if (algolia.config.stock_policy) { if (algolia.config.stock_policy === 'allow') { /** * For 'allow', we don't need to add any filter as we want to continue * displaying all out of stock items. */ } else if (algolia.config.stock_policy === 'deny') { // For 'deny' we will filter out all items based on inventory quantity stockPolicyFilter = 'inventory_quantity > 0'; } else if (algolia.config.stock_policy === 'continue') { /** * For 'continue' we will filter on `inventory_available` attribute whose * value is dependent on: * `inventory_quantity > 0 OR inventory_policy == 'continue'` */ stockPolicyFilter = 'inventory_available:true'; } // Add the stock policy filter to the list of search filters if (stockPolicyFilter) { searchFilters.push(stockPolicyFilter); } } const activeSortOrders = collectionPageEnabled && algolia.collectionSortOrders ? algolia.collectionSortOrders : algolia.sortOrders; // Define all Algolia widgets to be initialized cache.client.addWidgets([ instantsearch.widgets.currentRefinements({ container: "#algolia-current-filters", cssClasses: { list: "current-filters__list", label: "hidden", category: "current-filters__item", categoryLabel: "current-filters__item--label", delete: ["current-filters__delete", "naked-link"] }, transformItems(items) { return items.map((item) => { if (item.attribute === "price_range") { return { ...item, refinements: formatPriceRefinements(item.refinements)} } else if (item.attribute === 'named_tags.Discount Amount') { return { ...item, refinements: item.refinements.map(r => { return { ...r, label: `${Math.round(r.label * 100)}% off` } }), }; } return item; }); } }), instantsearch.widgets.clearRefinements({ container: "#algolia-clear-all", templates: { resetLabel: "Clear All", }, cssClasses: { button: "text-link" } }), instantsearch.widgets.sortBy({ container: "#algolia-sort-by", items: algoliaSortIndices, cssClasses: { select: "algolia-sort-by__select", }, }), instantsearch.widgets.configure({ hitsPerPage: collectionPageEnabled && algolia.config.collections_full_results_hits_per_page ? algolia.config.collections_full_results_hits_per_page : algolia.config.products_full_results_hits_per_page, distinct: true, clickAnalytics: true, enablePersonalization: false, userToken: localStorage.getItem("algolia_user_token"), analyticsTags, filters: 'collections:womens-sweatpants-joggers-sale',}) ]); if(cache.type == "search") { // Hidden SearchBox widget that is used to update the results based on the url query parameter const customSearchBox = instantsearch.connectors.connectSearchBox(function(SearchBoxRenderingOptions, isFirstRendering) { if (isFirstRendering) { const query = new URL(window.location.href).searchParams.get("query"); if (query) { SearchBoxRenderingOptions.refine(query); document.querySelector("[data-search-results-title]").innerHTML = `Search Results For: ${query}`; } } if (SearchBoxRenderingOptions.query) { document.querySelector("[data-search-results-title]").innerHTML = `Search Results For: ${SearchBoxRenderingOptions.query}`; } }); cache.client.addWidget( customSearchBox({ containerNode: $('#algolia-search-box'), }) ); } // Mobile custom sort-by widget that uses radio inputs instead of a select element (Mobile Only) const customSortBySelector = instantsearch.connectors.connectSortBy(function(SortBySelectorRenderingOptions, isFirstRendering) { if (isFirstRendering) { SortBySelectorRenderingOptions.widgetParams.container.html(''); SortBySelectorRenderingOptions.widgetParams.container .find('div') .on('change', function(event) { const newSortOption = SortBySelectorRenderingOptions.options.find((option) => option.value === event.target.value); document.querySelector("[data-open-sorting-text]").innerHTML = `Sort by: ${newSortOption.label}`; SortBySelectorRenderingOptions.refine(event.target.value); closeMobileSorting(); }); } const optionsHTML = SortBySelectorRenderingOptions.options.map(function(option) { return `

`; }); SortBySelectorRenderingOptions.widgetParams.container .find('div') .html(optionsHTML); }); cache.client.addWidget( customSortBySelector({ container: $('#algolia-sort-by-mobile'), items: algoliaSortIndices, }) ); // Custom Pagination widget that uses a select element instead of individual page buttons const customPagination = instantsearch.connectors.connectPagination(function(PaginationRenderingOptions, isFirstRendering) { const currentPage = PaginationRenderingOptions.currentRefinement; PaginationRenderingOptions.widgetParams.containerNode.html(`

Page: of ${PaginationRenderingOptions.nbPages}

`); // Remove event listeners before replacing markup PaginationRenderingOptions.widgetParams.containerNode .find('select') .each(function() { $(this).off('change'); }); PaginationRenderingOptions.widgetParams.containerNode .find('button') .each(function() { $(this).off('click'); }); // Append select options const options = PaginationRenderingOptions.pages .map(function(page) { const pageNumber = Theme.Global.safeParseInt(page) + 1; return ``; }).join(""); PaginationRenderingOptions.widgetParams.containerNode .find('select') .html(options); // Add event listeners PaginationRenderingOptions.widgetParams.containerNode .find('select').on('change', function(event) { event.preventDefault(); PaginationRenderingOptions.refine($(this).val()); $('html, body').animate({ scrollTop: 0 }, 300); }); PaginationRenderingOptions.widgetParams.containerNode .find('[data-algolia-prev-page]').on('click', function(event) { event.preventDefault(); PaginationRenderingOptions.refine(currentPage - 1); $('html, body').animate({ scrollTop: 0 }, 300); }); PaginationRenderingOptions.widgetParams.containerNode .find('[data-algolia-next-page]').on('click', function(event) { event.preventDefault(); PaginationRenderingOptions.refine(currentPage + 1); $('html, body').animate({ scrollTop: 0 }, 300); }); }); cache.client.addWidget( customPagination({ containerNode: $('#algolia-pagination'), maxPages: 100, padding: 100, }) ); // Product results widget const customHits = instantsearch.connectors.connectHits(function(HitsRenderingOptions, isFirstRendering) { if (!HitsRenderingOptions.results) { return; } if(HitsRenderingOptions.results.renderingContent?.redirect?.url) { window.location = HitsRenderingOptions.results.renderingContent?.redirect?.url; return; } document.querySelector("[data-search-results-count]").innerHTML = `(${HitsRenderingOptions.results.nbHits})`; let markup = "No products found"; if (HitsRenderingOptions.hits.length) { markup = ` `; } HitsRenderingOptions.widgetParams.containerNode.html(markup); if(HitsRenderingOptions.hits.length) { var power_review_products = []; var origin = new URL(window.location.href).origin; HitsRenderingOptions.hits.forEach((product, index, array) => { var markup = buildProductCard(product, origin, index); $('.product-results').append(markup); power_review_products.push({ api_key: Theme.settings.reviews.api_key, locale: Theme.settings.reviews.locale, merchant_group_id: Theme.settings.reviews.group_id, merchant_id: Theme.settings.reviews.merchant_id, page_id: product.id, components: { CategorySnippet: `snippet-${product.id}` } }); power_review_products.push({ api_key: Theme.settings.reviews.api_key, locale: Theme.settings.reviews.locale, merchant_group_id: Theme.settings.reviews.group_id, merchant_id: Theme.settings.reviews.merchant_id, page_id: product.id, components: { CategorySnippet: `hover-snippet-${product.id}` } }); // On the last loop iteration, retrieve the URL from sessionStorage and update it with the current URL if (index === array.length - 1) { let previousLocation = JSON.parse(sessionStorage.getItem("previouslocation")) || {}; previousLocation.url = window.location.href; sessionStorage.setItem("previouslocation", JSON.stringify(previousLocation)); } }); // Initialize Swym wishlist buttons after products are loaded document.dispatchEvent(new CustomEvent("swym:collections-loaded")); var icons = document.querySelectorAll('.swym-ais-button'); icons.forEach(i => { i.style.visibility = 'visible'; }); if(Theme.settings.reviews.enabled) { setTimeout(() => { pwr('render', power_review_products); }, 150); } } }); cache.client.addWidget( customHits({ containerNode: $('#algolia-hits'), }) ); // Initialize widgets cache.client.start(); } function sendFilterClickedEvent(e) { const { filterAttribute, filterValue } = e.target.dataset; if (filterAttribute && filterValue) { const userToken = localStorage.getItem("algolia_user_token"); if (userToken) { aa('clickedFilters', { userToken: userToken, index: Theme.algolia.product_index, eventName: 'PLP: Filter Clicked', filters: [`${filterAttribute}:${filterValue}`] }); } } } function sendProductClickedAfterSearchEvent() { const { objectId, queryId, position, productId } = this.closest(".algolia-product-card__wrapper").dataset; const parsedPosition = window.Theme.Global.safeParseInt(position); if (objectId && queryId && parsedPosition) { const userToken = localStorage.getItem("algolia_user_token"); cache.queryId = queryId; cache.objectId = objectId; cache.productId = productId; if (userToken) { aa('clickedObjectIDsAfterSearch', { userToken: userToken, eventName: this.classList.contains('algolia-product-card__quickview') ? 'PLP: Product Quickview Clicked' : 'PLP: Search Result Clicked', index: Theme.algolia.product_index, queryID: queryId, objectIDs: [objectId], positions: [parsedPosition] }); addProductToLocalStorage(objectId, productId, queryId); } } } function sortRefinementsAlphabetically(items, ascending) { return items.sort((a, b) => { const normalizedA = a.value.toLowerCase(); const normalizedB = b.value.toLowerCase(); if (normalizedA < normalizedB) return ascending ? -1 : 1; if (normalizedA > normalizedB) return ascending ? 1 : -1; return 0; }); } function formatSizeRefinements(items) { let sorted = Shopify.API.sortFiltersBySize(items, "plp"); return sorted } function formatPriceRefinements(items) { return items .sort((a, b) => Theme.Global.safeParseInt(a.value.split(':')[0]) - Theme.Global.safeParseInt(b.value.split(':')[0])) .map((item, i) => { const lower = item.value.split(':')[0]; const upper = item.value.split(':')[1]; let label = `$${lower}-$${upper}`; if (i === 0) { label = `Under $${upper}`; } else if (i === items.length - 1) { label = `Over $${lower}`; } return { ...item, label }; }); } function _itemsSorted() { if(DynamicYield) { var value = this.value.split("_"); var order = value.pop(); if(order != "asc" && order != "desc") { value.push(order); order = "desc"; } value = value.join("_"); DynamicYield.sortItems(value, order); } } function appendFilterElements() { const markup = window.Theme.algolia.filters.map((filter) => { if (filter.isSize) { filterContainerIds[filter.id] = "#algolia-refinement-size"; return ``; } else if (filter.isColour) { filterContainerIds[filter.id] = "#algolia-refinement-colour"; return ``; } else { filterContainerIds[filter.id] = `#algolia-refinement-${filter.id.replace(' ', '_')}`; return `` } }).join(""); document.querySelector(".screen-takeover__body").innerHTML = markup; } function hideChat() { try { const launcher = document.getElementById('launcher'); if(launcher) { launcher.dataset.width = launcher.clientWidth launcher.style.display = 'none'; } } catch (e) { console.error(e); } } function showChat() { try { const launcher = document.getElementById('launcher'); if(launcher) { launcher.style.display = ''; launcher.style.width = launcher.dataset.width + 'px'; } } catch (e) { console.error(e); } } function openMobileFilters() { document.querySelector("[data-screen-takeover-filters]").classList.remove("screen-takeover__hidden"); $(`.ais-root__collapsible`).each(function() { $(this).addClass("ais-root__collapsed") }); document.documentElement.style.overflow = "hidden"; hideChat(); } function closeMobileFilters() { document.querySelector("[data-screen-takeover-filters]").classList.add("screen-takeover__hidden"); document.documentElement.style.overflow = "auto"; showChat(); } function openMobileSorting() { document.querySelector("[data-screen-takeover-sorting]").classList.remove("screen-takeover__hidden"); document.documentElement.style.overflow = "hidden"; hideChat(); } function closeMobileSorting() { document.querySelector("[data-screen-takeover-sorting]").classList.add("screen-takeover__hidden"); document.documentElement.style.overflow = "auto"; showChat(); } function toggleFilter(e) { if (e.which == 13) { this.closest(".refinement-group__item").click(); } } function buildProductCard(product, origin, index) { const discountAmount = product.compare_at_price > product.price ? product.named_tags['Discount Amount'] : null; const global_access = product.tags.includes("GlobalAccess_Yes") || product.tags.includes("Exclusivity_JD"); const title = Theme.settings.locale === 'fr' ? product.meta?.translations?.french_title || product.title : product.title; let string = `

${title}

${product.compare_at_price ? "

"+product.compare_at_price.dollar()+"

"+ " Now "+product.price.dollar()+"" : product.price.dollar() }

${title}

${product.compare_at_price ? "

"+product.compare_at_price.dollar()+"

"+ " Now "+product.price.dollar()+"" : product.price.dollar() }

`; return string; } async function buildProductGroup(target, handle, products) { let mobile_images = `

`; let variant_images = `

`; products.forEach((product) => { if(product.handle == handle) { mobile_images += `

Women's Sweatpants & Joggers Sale (3)

`; variant_images += `

` } }); products.forEach((product) => { if(product.handle != handle) { mobile_images += `

Women's Sweatpants & Joggers Sale (5)

`; variant_images += `

` } }); mobile_images += `

`; variant_images += `

`; //target.querySelector("[data-image-mobile]").innerHTML = mobile_images; target.querySelector("[data-variant-container]").innerHTML = variant_images; //Theme.Global.initializeTinySlider(document.querySelector(`[data-carousel='algolia-mobile-images-${handle}']`)); Theme.Global.initializeTinySlider(document.querySelector(`[data-carousel='algolia-product-card-${handle}']`)); target.querySelector("[data-color-count]").innerHTML = `${products.length > 1 ? `${products.length}`: '1'} ${Theme.strings.collections.product.colour}${products.length > 1 ? 's': ''}`; document.dispatchEvent(new CustomEvent("swym:collections-loaded")); } async function getProductGrouping() { var target = this; var handle = this.getAttribute("data-product-card"); var group_id = this.getAttribute("data-group-id"); if(group_id) { Shopify.API.getProductGroup(group_id).then((products) => { buildProductGroup(target, handle, products); }); } else { Shopify.API.getProduct(handle).then((product) => { buildProductGroup(target, handle, [product]); }); } } function openProductQuickview() { const handle = $(this).data("productHandle"); const group = $(this).data("productGroup"); const string = `
`; $.fancybox.open(string); if(group) { Shopify.API.getProductGroup(group) .then(_buildPDPColorPicker) .then(() => { _buildPDP(handle) }); } else { Shopify.API.getProduct(handle) .then( _buildPDPColorPicker) .then(() => { _buildPDP(handle) }); } } function _buildPDP(handle) { if (typeof handle == "string") { cache.handle = handle; } else { cache.handle = this.value; } if(this) { handle = this.value; if(DynamicYield && this.getAttribute) { var color = this.getAttribute("data-color-option"); DynamicYield.changeAttribute("Color", color); } } var product = cache.products[handle]; var variantId = (product && product.variants) ? String(product.variants[0].id) : ""; if(handle && product) { const userToken = localStorage.getItem("algolia_user_token"); if (userToken) { aa('viewedObjectIDs', { userToken: userToken, eventName: 'Product Viewed', index: window.Theme.algolia.product_index, objectIDs: [String(product.variants[0].id)], }); } } if(!product) { return; } document.querySelector(".pdp__quickview [data-product-title]").innerHTML = product?.title; document.querySelector(".pdp__quickview [data-product-price]").innerHTML = (product?.compare_at_price) ? `${product.compare_at_price.money()} Now ${product.price.money()}` : product?.price.money(); _buildPDPImages(product); _buildPDPThumbnails(product); _buildPDPSizePicker(product); _buildPDPFinalSale(product); _buildPDPWishlistButton(product, variantId); } function _buildPDPWishlistButton(product, variantId) { var origin = new URL(window.location.href).origin; document.querySelector("[data-wishlist-button]").innerHTML = `` // Initialize Swym wishlist button after it is loaded document.dispatchEvent(new CustomEvent("swym:variant-changed")); } function _buildPDPImages(product) { var string = " \ "; document.querySelector("[data-media-wrapper]").innerHTML = string; cache.featured_image = Theme.Global.initializeTinySlider(document.querySelector("[data-carousel='pdp_media']")); return product; } function _buildPDPSizePicker(product) { Shopify.API.sortVariantsBySize(product.variants); product.variants.forEach((variant, index) => { var string = " \

\ \ \

"; if(index == 0) { document.querySelector("[data-size-container]").innerHTML = ""; } document.querySelector("[data-size-container]").append(string.createContext()); }); return product; } function _buildPDPFinalSale(product) { const finalSaleMessage = Theme.Global.getFinalSaleMessage(product); if(finalSaleMessage) { document.querySelector('[data-final-sale-text]').innerHTML = `

${finalSaleMessage}

`; } else { document.querySelector('[data-final-sale-text]').innerHTML = ''; } return product; } function _changeFeaturedImage() { var index = this.getAttribute("data-pdp-thumbnail"); document.querySelector("[data-pdp-thumbnail][aria-active='true']").setAttribute("aria-active", false); this.setAttribute("aria-active", true); Theme.Global.getTinySlider("pdp_media").goTo(index); } function _buildPDPThumbnails(product) { var string = ""; product.media.forEach((media, index) => { string += " \
  • \ Women's Sweatpants & Joggers Sale (9)"; if(media.media_type == "video") { string += " \

    \

    "; } string += " \
  • "; }); document.querySelector("[data-thumbnail-wrapper]").innerHTML = string; return product; } function _buildPDPColorPicker(products) { if(!products.length) { products = [products] } products.forEach((product, index) => { cache.products[product.handle] = product; var string = " \

    \ \ \

    "; if(index == 0) { document.querySelector("[data-color-options]").innerHTML = ""; } document.querySelector("[data-color-options]").append(string.createContext()); }); var handle = document.querySelector("[data-pdp-section]").getAttribute("data-pdp-section"); document.querySelector("[data-color-option][value='"+handle+"']").click(); return products; } document.addEventListener('DOMContentLoaded', function() { _init(); }); return {} })(window.algoliaShopify);
    Women's Sweatpants & Joggers Sale (2024)

    References

    Top Articles
    Latest Posts
    Article information

    Author: Domingo Moore

    Last Updated:

    Views: 6208

    Rating: 4.2 / 5 (73 voted)

    Reviews: 80% of readers found this page helpful

    Author information

    Name: Domingo Moore

    Birthday: 1997-05-20

    Address: 6485 Kohler Route, Antonioton, VT 77375-0299

    Phone: +3213869077934

    Job: Sales Analyst

    Hobby: Kayaking, Roller skating, Cabaret, Rugby, Homebrewing, Creative writing, amateur radio

    Introduction: My name is Domingo Moore, I am a attractive, gorgeous, funny, jolly, spotless, nice, fantastic person who loves writing and wants to share my knowledge and understanding with you.