• Resolved abuzon

    (@abuzon)


    Hello,
    Just wanted to let you know of a conflict I just discovered when “Defer Render-blocking JS” is turned on. On the Checkout page, for users not yet logged in, there’s a link that says “Returning customer? Click here to login”. The link is supposed to expand out a hidden login form. Instead, just nothing happens.
    Might be doing something funny to checkout.min.js?
    /woocommerce/assets/js/frontend/checkout.min.js – it does mention the class called for that section, showlogin

      , t = {
            init: function() {
                g(document.body).on("click", "a.showlogin", this.show_login_form)
            },
            show_login_form: function() {
                return g("form.login, form.woocommerce-form--login").slideToggle(),
                !1
            }

    Doesn’t seem to be theme specific, but I’m using Beaver Builder child theme.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Hristo Pandjarov

    (@hristo-sg)

    SiteGround Representative

    Did you try excluding this file from the optimization?

    Thread Starter abuzon

    (@abuzon)

    No matter what I try to enter, it says “Nothing was found” and won’t let me add it. Tried the full address of the file location, the path from /wp-content on, just checkout.min.js; no matter how I put it, I can’t add it to Exclude.

    Plugin Author Hristo Pandjarov

    (@hristo-sg)

    SiteGround Representative

    It is a drop-down list, so if you can’t find the script in it, it means that is loaded in some funky way, not using the enqueue script functionality of WordPress. If you give me your website, I can look into it and exclude the proper script with a filter that we support or you can try it yourself if you know the script handle.

    add_filter( 'sgo_js_async_exclude', 'js_async_exclude' );
    function js_async_exclude( $exclude_list ) {
        $exclude_list[] = 'script-handle';
        $exclude_list[] = 'script-handle-2';
    
        return $exclude_list;
    }
    
    add_filter( 'sgo_js_minify_exclude', 'js_minify_exclude' );
    function js_minify_exclude( $exclude_list ) {
        $exclude_list[] = 'script-handle';
        $exclude_list[] = 'script-handle-2';
    
        return $exclude_list;
    }
    Thread Starter abuzon

    (@abuzon)

    Thanks for getting back to me so quickly Hristo! I swear, you do so much within the WP community, I don’t know if you cloned yourself or what; either way, I hope they’re compensating you well!

    The site is partakekitchen.com

    Would I be able to just add those lines to my functions.php file?

    I would think BB and WooCommerce would both enqueue “by the book” – could Wordfence effect it?

    Thanks again!

    Plugin Author Hristo Pandjarov

    (@hristo-sg)

    SiteGround Representative

    Unfortunatelly, we haven’t developed that tech…yet. Although I could use some clones ??

    This said, here’s the filter you should add to your functions.php file:

    add_filter( 'sgo_js_async_exclude', 'js_async_exclude' );
    function js_async_exclude( $exclude_list ) {
        $exclude_list[] = 'sv-wc-payment-gateway-payment-form';
        return $exclude_list;
    }

    We will globally exclude this script too so after the next plugin update you won’t have to keep it in your functions.php file. That should happen Tueseday 10th ??

    Ihave similar problem with amazon pay plugin. When activate Defer JS the button disapears and dev tools show an error the script amazon-app-widges.min.js.

    I try to exclude that script with that code:
    ———–
    add_filter( ‘sgo_js_async_exclude’, ‘js_async_exclude’ );
    function js_async_exclude( $exclude_list ) {
    $exclude_list[] = ‘amazon-app-widgets’;
    return $exclude_list;
    }
    ———-

    But doesn’t work. Same error on console.

    My webpage is mamabepo.com/carrito

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Defer JS conflict with WooCommerce Checkout Login’ is closed to new replies.