Skip to content
(function () {
function updateSelectedCategory() {
var heading = document.getElementById('selected-category-title');
if (!heading) {
return;
}
var active = document.querySelector(
'.cpf-filter__choice.is-active .cpf-filter__label'
);
if (active) {
heading.innerHTML = active.textContent.trim();
} else {
heading.innerHTML = 'All Products';
}
}
document.addEventListener('DOMContentLoaded', function () {
updateSelectedCategory();
// Check repeatedly because ACE updates the filter dynamically
setInterval(function () {
updateSelectedCategory();
}, 300);
});
})();