Restrict Opening Hours to certain categories and hide Open 24/7 where applicable

hi there,
I am using rentalhive and the code mentioned in the post: Restrict Opening Hours to certain categories and hide Open 24/7 where applicable

does not work for me to restrict the Open Now filter on the search fitlers to specfici categories.

document.addEventListener("DOMContentLoaded", function () {
    const hideOnPaths = [
        "/asdfasdfasdfs/"
    ];

    const currentPath = window.location.pathname;

    if (hideOnPaths.some(path => currentPath.startsWith(path))) {
        const labels = document.querySelectorAll('.hp-form__field--checkbox label');

        labels.forEach(label => {
            if (label.textContent.trim().includes("Jetzt geöffnet")) {
                label.style.display = 'none';
            }
        });
    }
});

chatgpt gave me this… wiorks too :slight_smile:

Hi,

Thank you for your solution, it will be useful for our community.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.