• Resolved dodo90z

    (@dodo90z)


    Conditionally opening Popup Maker popup

    I am trying to conditionally load a popup in WordPress. The popup is configured in the plugin Popup Maker and has a CSS class of “popmake-2503”.

    I’ve created a function in my theme’s functions.php which loads a script conditionally:`
    FUNCTION.PHP

    
    
    /*POPUP MAKER PLUGIN*/
    // open popup
    function open_popup() {
    if( is_user_logged_in() && is_page('checkout') )
        {
        wp_enqueue_script(
            'open-popup',
            get_stylesheet_directory_uri() . '/open-popup.js',
    array( 'jquery' )
                );
            }
        }
    add_action( 'wp_footer', 'open_popup' );
    

    JS:

    jQuery(document).ready(function($) {
       setTimeout(function() {
        //  alert ('runningssssssssssssss');
            $('.popmake-22784').popmake('open');
        }, 2000);
    });

    How can display this popup in this page
    this is screen shots to understand
    https://ibb.co/KjKJ5X3
    https://ibb.co/h26RST8
    thank you

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Maria T

    (@mariatogonon)

    Hi @dodo90z – thank you for writing in to us!

    If I understand your query correctly, you are trying to trigger a popup when a user is logged in to the site and when the user enters the Check Out page.

    We actually do have a premium extension plugin that will do that work for you.

    I would now suggest check out the Advanced Targeting Condition extension plugin: https://wppopupmaker.com/extensions/advanced-targeting-conditions/
    ?
    ?You will just need to set a User Targeting Condition to (!) Is Logged In. This condition means, the popup will only be displayed once a user is logged in. Please see this documentation for more details, https://docs.wppopupmaker.com/article/238-advanced-targeting-conditions-user-conditions

    And, if you want the popup to be trigger when the user access the CheckOut page then please see this demo screencast from my end on how to set its condition-> https://share.getcloudapp.com/YEuZzAez

    Hope that helps.

    In case you still want to use custom scripts to be able to achieve that then it is your call.

    If you have any other question or concerns, just let us know.

Viewing 1 replies (of 1 total)
  • The topic ‘popup open when user login and checkout Page’ is closed to new replies.