style> /* Spinner */ .loader-spinner { display: none; margin: 20px auto; border: 4px solid #f3f3f3; border-top: 4px solid #B39654; /* Twój złoty kolor */ border-radius: 50%; width: 40px; height: 40px; animation: spin 1s linear infinite; } @keyframes spin { 0% { transform: rotate(0deg);} 100% { transform: rotate(360deg);} }
script> document.addEventListener("DOMContentLoaded", function() { const categories = { 'elementor-repeater-item-7f5905a': { slug: '', title: 'Wszystkie oprawy', description: '' }, 'elementor-repeater-item-9e4736d': { slug: 'kobieta', title: 'Kobieta - Bentivolio', description: 'Opis kategorii Kobieta.' }, 'elementor-repeater-item-b65295a': { slug: 'mezczyzna', title: 'Mężczyzna - Bentivolio', description: 'Opis kategorii Mężczyzna.' }, 'elementor-repeater-item-6225cc2': { slug: 'dziecko', title: 'Dziecko - Bentivolio', description: 'Opis kategorii Dziecko.' } }; function handleCategoryClick(itemId) { const category = categories[itemId]; if (!category) return; if (category.title) document.title = category.title; const descElement = document.getElementById('archive-description'); if (descElement && category.description) { descElement.textContent = category.description; } // Animacja kliknięcia const activeElement = document.querySelector(`.premium-tabs-nav-list-item.${itemId}`); if (activeElement) { activeElement.classList.add('clicked-animation'); setTimeout(() => { activeElement.classList.remove('clicked-animation'); }, 500); } reloadProducts(category.slug); const newPath = category.slug ? `/sklep/${category.slug}` : `/sklep/`; window.history.pushState({}, '', newPath); } document.querySelectorAll('.premium-tabs-nav-list-item').forEach(item => { item.addEventListener('click', function(e) { e.preventDefault(); const classes = Array.from(this.classList); const found = classes.find(c => categories[c]); if (found) { handleCategoryClick(found); } }); }); function reloadProducts(categorySlug) { let productContainer = document.querySelector('.woocommerce ul.products'); // Tworzenie kontenera jeśli nie istnieje if (!productContainer) { const woocommerceContainer = document.querySelector('.woocommerce'); if (woocommerceContainer) { const newProductList = document.createElement('ul'); newProductList.classList.add('products'); woocommerceContainer.appendChild(newProductList); productContainer = newProductList; } } if (productContainer) { const loader = document.getElementById('loader'); loader.style.display = 'block'; productContainer.style.opacity = '0.5'; fetch('/wp-admin/admin-ajax.php', { method: 'POST', headers: { 'Content-Type': 'application/x-www-form-urlencoded', }, body: `action=filter_products_by_category&category=${categorySlug}` }) .then(response => response.text()) .then(html => { const parser = new DOMParser(); const doc = parser.parseFromString(html, 'text/html'); const newProducts = doc.querySelector('.products'); if (newProducts) { productContainer.innerHTML = newProducts.innerHTML; } productContainer.style.opacity = '1'; loader.style.display = 'none'; // Odśwież WooCommerce fragmenty (opcjonalne, jeśli potrzeba) jQuery('body').trigger('updated_wc_div'); }) .catch(error => { console.error('Błąd ładowania produktów AJAX:', error); productContainer.style.opacity = '1'; loader.style.display = 'none'; }); } } function activateTabBasedOnURL() { const url = window.location.href; if (url.includes("/kobieta")) { handleCategoryClick('elementor-repeater-item-9e4736d'); } else if (url.includes("/mezczyzna")) { handleCategoryClick('elementor-repeater-item-b65295a'); } else if (url.includes("/dziecko")) { handleCategoryClick('elementor-repeater-item-6225cc2'); } else if (url.includes("/sklep")) { const allCategoriesButton = document.querySelector('.premium-tabs-nav-list-item.elementor-repeater-item-7f5905a'); if (allCategoriesButton) { allCategoriesButton.click(); // wymuszamy kliknięcie "Wszystkie oprawy" } } } activateTabBasedOnURL(); });
script> function reloadProducts(categorySlug) { let productContainer = document.querySelector('.woocommerce ul.products'); // Jeśli kontenera brak - twórz nowy if (!productContainer) { const woocommerceContainer = document.querySelector('.woocommerce'); if (woocommerceContainer) { const newProductList = document.createElement('ul'); newProductList.classList.add('products'); woocommerceContainer.appendChild(newProductList); productContainer = newProductList; } } if (productContainer) { productContainer.style.opacity = '0.5'; fetch('/wp-admin/admin-ajax.php', { method: 'POST', headers: { 'Content-Type': 'application/x-www-form-urlencoded', }, body: `action=filter_products_by_category&category=${categorySlug}` }) .then(response => response.text()) .then(html => { const parser = new DOMParser(); const doc = parser.parseFromString(html, 'text/html'); const newProducts = doc.querySelector('.products'); if (newProducts) { productContainer.innerHTML = newProducts.innerHTML; } productContainer.style.opacity = '1'; }) .catch(error => { console.error('Błąd ładowania produktów AJAX:', error); productContainer.style.opacity = '1'; }); } }
OPRAWKI DAMSKIE
OPRAWKI MĘSKIE
Wszystkie kategorie

10%

zniżki, specjalnie dla ciebie 🎁

Zarejestruj się, aby otrzymać zniżkę specjalną i być na bieżąco z naszymi najnowszymi produktami i ofertami!

Nie spamujemy! Przeczytaj naszą politykę prywatności, aby uzyskać więcej informacji.

Zaloguj się

lub

Załóż konto

Lista salonów

Kontakt

PL