function moveCategoryDescription() {
setTimeout(() => {
document.querySelectorAll(".ec-category-description").forEach(description => {
const categoryPage = description.closest(".ecwid-productBrowser-categoryPage");
const productGrid = categoryPage?.querySelector(".grid-category");
if (productGrid && description) {
productGrid.parentNode.appendChild(description); // Force move description below products
}
});
}, 800); // Delay ensures Ecwid has fully loaded elements
}
// Run on initial page load
document.addEventListener("DOMContentLoaded", moveCategoryDescription);
// Run on AJAX navigation changes
Ecwid.OnPageLoaded.add(moveCategoryDescription);
// Run constantly to detect any changes in Ecwid’s dynamic content loading
const observer = new MutationObserver(moveCategoryDescription);
observer.observe(document.body, { childList: true, subtree: true });