Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi all,

    Yesterday I installed this plugin and also don’t like standard alert pop up window.

    I figured it out by changing standard javascript alert pop up for Sweetalert. It looks pretty well and professional. My knowledge about coding isn’t very good, but I did it without any problem and it is work perfectly.

    Here is step by step instruction how I do that:

    1. First you have to download plugin files from here: Sweetalert

    2. Then you must Unzip downloaded package, and upload two files via ftp to your theme folder: sweetalert.min.js and sweetalert.css
    I uploaded them to new created folder: /sweetalert

    3. Next you have to add this code to the function.php in this way:

    function sweetalert_script () {
        wp_enqueue_script(
            'sweetalert_script',
            get_stylesheet_directory_uri() . '/sweetalert/sweetalert.min.js',
            array( 'jquery' )
        );
    }
    add_action( 'wp_enqueue_scripts', 'sweetalert_script' );
    
    function sweetalert_style ()  {
        wp_enqueue_style( 'style', get_stylesheet_uri() );
        wp_enqueue_style( 'sweetalert_style', get_stylesheet_directory_uri().'/sweetalert/sweetalert.css' );
    }
    add_action( 'wp_enqueue_scripts', 'sweetalert_style' );

    4.Last thing what you need to do is changing all alert calling in the plugin js file. You can find it here: wp-content/plugins/email-subscribers/widget/es-widget-page.js

    You have to change it in this way. For example this line:
    alert("Please enter email address.");

    for this:
    swal({ title: "Error!", text: "Please enter email address.", type: "error"});

    Of course for success messages change type: "error" for type: "success".

    All instructions you can find on the plugin website: Sweetalert
    I hope this helps you and others ??

    Best Regards,
    Adam

    Thread Starter Lock-N-Load

    (@lock-n-load)

    Awesome, I will try and report back. Thanks!

    Thanks for the new solution.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Can I stop the javascript alert pop-up?’ is closed to new replies.