...

Shop

BRANDS

CATEGORIES

CONCERNS

/* Import Montserrat font */ @import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600;700&display=swap'); #husky-filter-display { margin-bottom: 25px; padding: 15px 20px; background: #f8f9fa; border-left: 4px solid #000000; border-radius: 4px; font-family: 'Montserrat', sans-serif; } #husky-filter-display p { margin: 0; font-size: 16px; color: #333333; line-height: 1.5; font-family: 'Montserrat', sans-serif; } #husky-filter-display strong { font-weight: 600; color: #000000; font-family: 'Montserrat', sans-serif; } #husky-filter-text { color: #666666; font-weight: 400; font-family: 'Montserrat', sans-serif; } .husky-clear-filters { display: inline-block; margin-left: 15px; padding: 5px 12px; background: #000000; color: #ffffff; text-decoration: none; border-radius: 4px; font-size: 14px; font-family: 'Montserrat', sans-serif; font-weight: 600; transition: background 0.3s ease; } .husky-clear-filters:hover { background: #333333; color: #ffffff; } #no-products-message { margin-top: 15px; padding: 15px 20px; background: #fff3cd; border-left: 4px solid #ffc107; border-radius: 4px; font-family: 'Montserrat', sans-serif; display: none; } #no-products-message p { margin: 0; font-size: 15px; color: #856404; font-weight: 600; font-family: 'Montserrat', sans-serif; } @media (max-width: 768px) { #husky-filter-display { padding: 12px 15px; } #husky-filter-display p { font-size: 14px; } .husky-clear-filters { display: block; margin-left: 0; margin-top: 10px; text-align: center; } #no-products-message p { font-size: 14px; } }

Showing Results for: All Products

⚠️ NO PRODUCTS FOUND FOR THE FILTER YOU HAVE SELECTED

document.addEventListener('DOMContentLoaded', function() { const filterDisplay = document.getElementById('husky-filter-text'); const clearLink = document.getElementById('clear-filters-link'); const noProductsMsg = document.getElementById('no-products-message'); let filterText = []; let hasFilters = false; // Get current URL path const currentPath = window.location.pathname; // Check if URL contains /swoof/ (Husky's filter path) if (currentPath.includes('/swoof/')) { // Extract everything after /swoof/ const swoofIndex = currentPath.indexOf('/swoof/'); const swoofPart = currentPath.substring(swoofIndex + 7); if (swoofPart && swoofPart.length > 1) { const cleanPath = swoofPart.replace(/\/$/, ''); const filterSegments = cleanPath.split('/'); filterSegments.forEach(function(segment) { if (segment && segment.includes('-')) { const firstDashIndex = segment.indexOf('-'); const value = segment.substring(firstDashIndex + 1); let attrValue = decodeURIComponent(value) .replace(/-/g, ' ') .replace(/_/g, ' ') .replace(/\b\w/g, l => l.toUpperCase()); filterText.push(attrValue); hasFilters = true; } }); } } // Also check for standard query parameters const urlParams = new URLSearchParams(window.location.search); urlParams.forEach(function(value, key) { if (key !== 'paged' && key !== 'orderby' && key !== 's') { let valueLabel = decodeURIComponent(value) .replace(/-/g, ' ') .replace(/_/g, ' ') .replace(/\b\w/g, l => l.toUpperCase()); if (key === 'min_price' || key === 'max_price') { return; } filterText.push(valueLabel); hasFilters = true; } }); // Price filter const minPrice = urlParams.get('min_price'); const maxPrice = urlParams.get('max_price'); if (minPrice || maxPrice) { const min = minPrice ? '$' + minPrice : '$0'; const max = maxPrice ? '$' + maxPrice : '∞'; filterText.push(min + ' - ' + max); hasFilters = true; } // Display filters if (hasFilters && filterText.length > 0) { filterDisplay.innerHTML = filterText.join(' | '); clearLink.style.display = 'inline-block'; // Check for products after a delay (wait for WooCommerce to load) setTimeout(function() { checkForProducts(); }, 1500); // Also check again after longer delay (in case of slow loading) setTimeout(function() { checkForProducts(); }, 3000); } else { filterDisplay.innerHTML = 'All Products'; clearLink.style.display = 'none'; noProductsMsg.style.display = 'none'; } }); // Run check when window fully loads window.addEventListener('load', function() { setTimeout(function() { const currentPath = window.location.pathname; if (currentPath.includes('/swoof/')) { checkForProducts(); } }, 2000); }); function checkForProducts() { const noProductsMsg = document.getElementById('no-products-message'); let productsFound = false; // Check 1: Look for actual product elements const productElements = document.querySelectorAll('li.product, .product-item, .type-product'); if (productElements && productElements.length > 0) { productsFound = true; } // Check 2: Look for WooCommerce product grid const productGrid = document.querySelector('ul.products'); if (productGrid) { const productsInGrid = productGrid.querySelectorAll('li'); if (productsInGrid && productsInGrid.length > 0) { productsFound = true; } } // Check 3: Look for "No products found" message from WooCommerce const wooNotice = document.querySelector('.woocommerce-info'); if (wooNotice) { const noticeText = wooNotice.textContent.toLowerCase(); if (noticeText.includes('no products') || noticeText.includes('found')) { productsFound = false; } } // Check 4: Look for empty results message const emptyMessage = document.querySelector('.woocommerce-no-products-found'); if (emptyMessage) { productsFound = false; } // Check 5: Check if product grid is empty const allLists = document.querySelectorAll('ul.products'); let hasAnyProducts = false; allLists.forEach(function(list) { if (list.children.length > 0) { hasAnyProducts = true; } }); if (!hasAnyProducts && allLists.length > 0) { productsFound = false; } // Show or hide message const currentPath = window.location.pathname; if (currentPath.includes('/swoof/') && !productsFound) { noProductsMsg.style.display = 'block'; } else { noProductsMsg.style.display = 'none'; } }
Call Now Button