Ai vizualizat 1944 din 2033 produse
0
Înapoi sus
document.addEventListener('DOMContentLoaded', function () {// На отдельной странице товара ничего не трогаем if (document.body.classList.contains('single-product')) { return; }function hideProductCategories() {document.querySelectorAll('ul.products li.product').forEach(function(card) {// 1. Стандартные блоки категорий WooCommerce/тем card.querySelectorAll( '.posted_in, .product-categories, .product-category-list, .category-list, .product-cat' ).forEach(function(el) { el.style.setProperty('display', 'none', 'important'); });// 2. Дополнительная проверка: // ищем ссылки, ведущие на категории товаров const categoryLinks = card.querySelectorAll( 'a[href*="/product-category/"]' );categoryLinks.forEach(function(link) {let container = link.parentElement;while (container && container !== card) {const linksInside = container.querySelectorAll( 'a[href*="/product-category/"]' );const importantContent = container.querySelector( '.woocommerce-loop-product__title, .price, .button, img' );/* * Если внутри блока несколько ссылок на категории * и нет названия товара, цены, кнопки или фото — * считаем этот блок списком категорий. */ if ( linksInside.length >= 2 && !importantContent ) { container.style.setProperty( 'display', 'none', 'important' );break; }container = container.parentElement; }});});}// При первой загрузке hideProductCategories();// Повторяем после AJAX-фильтрации, // сортировки, подгрузки товаров и т.п. const observer = new MutationObserver(function() { hideProductCategories(); });observer.observe(document.body, { childList: true, subtree: true });});
ro_RO

Căutare produse

Produsul a fost adăugat în coșul dvs.