• Resolved Darko G.

    (@darkog)


    I noticed that when using this plugin, the plugin doesn’t work with multiple popups on the page. I know this plugin might support displaying only one popup per page, however, to avoid breaking up the UI can you control this programatically? I mean, if two popups are about to show, can you make sure only one displays. Disable the other because obviously two popups can’t be shown at the same time. For example if you have 20 popups, 3 of them met the conditions to show, all three show and at the end nothing is really displayed, bonus, when this happens on some sites the scroll is gone, UI broken, it’s a hell.

    • This topic was modified 2 years, 11 months ago by Darko G..
Viewing 7 replies - 1 through 7 (of 7 total)
  • Bel

    (@belimperial)

    Hi @darkog

    Thanks for writing in!

    Multiple popups can be displayed on the same page. However, you would need to configure the popup settings. We have an article that can guide you to display multiple popups. Please see it Display Multiple Popups at the Same Time

    I also suggest checking the targeting condition. May we know if you have used an ‘OR’ operator with negative condition or ‘AND’ operator to target the page(s) where the popup will display. In case you are using an ‘OR’ operator with negative condition, kindly update it to use the ‘AND’ operator for each targeting condition.

    As for the scroll issue, could you please add the below CSS to your site. There might be a conflict to one of your plugins or theme and interferes with the popup CSS trigger. You may add it to your Appearance > Customize > Additional CSS.

    .pum-overlay.pum-active,
    .pum-overlay.pum-active .popmake.active {
        opacity: 1 !important;
        display: block !important;
    }

    I hope that helps. Let us know if the provided solution fix the issues or if you have any questions.

    Thread Starter Darko G.

    (@darkog)

    Hi @belimperial

    That doesn’t fixes the problem.

    The problem is that popup maker renders all popups that match the conditions set. How can we make it display only one at a time? So if multiple popups match specific condition, we should be able to display only one. Also, since we have many popups it’s not solution to add other conditions because it becomes a mess of conditions and is impossible to track them (think of: only one is sufficient).

    Best,
    Darko

    • This reply was modified 2 years, 11 months ago by Darko G..
    Thread Starter Darko G.

    (@darkog)

    Can you add a filter that will allow to filter the rendered popups so we can programmatically omit the popups.

    This function in file /classes/Site/Popups.php

    
    /**
    * Gets the loaded popup query.
    *
    * @return null|WP_Query
    */
    public static function get_loaded_popups() {
            if ( ! self::$loaded instanceof WP_Query ) {
                    self::$loaded        = new WP_Query();
                    self::$loaded->posts = [];
            }
    
            return self::$loaded;
    }
    

    Becomes:

    
    /**
    * Gets the loaded popup query.
    *
    * @return null|WP_Query
    */
    public static function get_loaded_popups() {
            if ( ! self::$loaded instanceof WP_Query ) {
                    self::$loaded        = new WP_Query();
                    self::$loaded->posts = [];
            }
    
            return apply_filters('pum_get_loaded_popups', self::$loaded);
    }
    
    Bel

    (@belimperial)

    Hi @darkog

    Thank you for getting back.

    I would need to forward your concern to our developer since it is a code related. This would fall under our premium support, and so please could you open a support ticket at our support portal, here: https://wppopupmaker.com/support/

    Thank you, and we look forward to hearing from you.

    Thread Starter Darko G.

    (@darkog)

    @belimperial i don’t use the premium version. I am talking about the free version.

    Thread Starter Darko G.

    (@darkog)

    Ok, i nailed it with using the built-in filters.

    To render only one popup per request and avoid rendering all others that match the conditions, you can add the following filter:

    
    /**
     * Render only one popup per request. 
     * Once that one popup is dismissed, the next one will show during the next page load.
     * This way you can avoid showing multiple popups at same time which is probably not supported and breaks the site layout at least for us.
     *
     * @param bool $loadable
     * @param int $popup_id
     * @author Darko G. <[email protected]>
     *
     * @return bool
     */
    function pum_popup_is_loadable_20211222($loadable, $popup_id) {
    
    	static $loadable_popups = array();
    
    	if(is_admin()) {
    		return $loadable;
    	}
    	if(!empty($loadable_popups)) {
    		return false;
    	}
    	if($loadable) {
    		$loadable_popups[$popup_id] = 1;
    	}
    	return $loadable;
    }
    add_filter( 'pum_popup_is_loadable', 'pum_popup_is_loadable_20211222', 0, 2);
    

    Have a nice holidays.

    • This reply was modified 2 years, 11 months ago by Darko G..
    • This reply was modified 2 years, 11 months ago by Darko G..
    • This reply was modified 2 years, 11 months ago by Darko G..
    Bel

    (@belimperial)

    Hi @darkog

    Thank you for getting back, and sharing the solution you made.

    I’ll inform our developer about the filter that you have used. Please do let us know if there’s anything else we can help you with.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Multiple popups problem’ is closed to new replies.