ResolvedProblem with branch PopUp

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #36497
    jose
    Participant

    Due to legal requirements, I need the branch selection popup not to open automatically on three pages of the website (for example, on the legal notice, privacy policy and contact pages). How can you do this from the file functions.php of the child theme

    #36513
    Alex
    Keymaster

    Hello Jose,

    We are looking for a solution and will let you know.

    Regards,
    Alex

    #36516
    jose
    Participant

    ok, i await your answer

    #36584
    Alex
    Keymaster

    Hello Jose,

    So, in order to achieve this you need to put following code in the child theme’s functions.php and adapt the page titles according your needs:

    add_action( "loop_start", function () {
    	if ( in_array( get_the_title(), array( "About Lafka", "Contact Us" ) ) ) {
    		remove_action( 'wp_footer', array( "Lafka_Branch_Locations", 'output_in_footer' ) );
    	}
    } );

    Also in the child theme’s lafka-front.js put following code:

        $(document).ready(function () {
            let magnificPopup = $.magnificPopup.instance;
            if(magnificPopup.content && typeof magnificPopup.content.attr('id') === 'undefined') {
                let branch_closed = sessionStorage.getItem('lafka_branch_selection_closed');
                magnificPopup.close();
                sessionStorage.setItem('lafka_branch_selection_closed', branch_closed);
            }
        });

    Regards,
    Alex

    #36585
    jose
    Participant

    It’s OK Thanks

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in and have valid license to reply to this topic.

License required for the following item
Login and Registration Log in · Register