• sibivfl

    (@sibivfl)


    I want to block a newsletter pop up when it is already opened with a click of the button (I have built my own code snippet for this).

    What I need is a global object name controlling the popup.

    This is the code I am trying to implement, and here I have this global object “mailpoetPopup” set.

    Now on my website I have mailpoet pop up appear after 15 sec and on exit intent.

    Please advise.

    Here is the code

    <script> document.getElementById("subscribe-popup-trigger").addEventListener("click", function(event) { event.preventDefault(); // Prevent page reload document.getElementById("newsletter-popup").style.display = "flex"; // Show custom popup // Disable automatic MailPoet popup if (typeof mailpoetPopup !== 'undefined') { mailpoetPopup.disable = true; // Assuming 'mailpoetPopup' is the global object controlling the popup } }); document.getElementById("close-popup").addEventListener("click", function() { document.getElementById("newsletter-popup").style.display = "none"; // Close custom popup // Re-enable automatic MailPoet popup if (typeof mailpoetPopup !== 'undefined') { mailpoetPopup.disable = false; // Re-enable the automatic popup } }); // Close popup when clicking outside the content document.getElementById("newsletter-popup").addEventListener("click", function(event) { if (event.target === document.getElementById("newsletter-popup")) { document.getElementById("newsletter-popup").style.display = "none"; // Re-enable automatic MailPoet popup if (typeof mailpoetPopup !== 'undefined') { mailpoetPopup.disable = false; // Re-enable the automatic popup } } }); </script>

    • This topic was modified 2 months ago by sibivfl.
Viewing 1 replies (of 1 total)
  • Plugin Support Gui A. a11n

    (@guicmazeredo)

    Hi there,

    Thanks for reaching out!

    Although we provide support for the plugin setup and functionality, customizing its setup is a bit outside our scope of support, I’m afraid. You may want to look into hiring a developer from the WooCommerce Customizations page, who may be able to help you with that.

    I hope this points your in the right direction!

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.