• Resolved Robert_ITman

    (@robert_itman)


    As the posts I found that led me to a solution for this are closed and incomplete – I’m adding this new topic to show what worked for me … hopefully this will save others the days it took me to solve this.

    Following code added before </body> on both cart and checkout pages – to add this code, I’m using the plugin “Tracking Code Manager” by Data443

    <script>
    // source: https://frique.me/blog/prevent-automatic-scrolling-to-checkout-error-in-woocommerce/
    jQuery( document.body ).on( 'checkout_error', function() {
        jQuery( 'html, body' ).stop();
    } );
    jQuery( document ).ajaxComplete( function() {
        if ( jQuery( 'body' ).hasClass( 'woocommerce-checkout' ) || jQuery( 'body' ).hasClass( 'woocommerce-cart' ) ) {
            jQuery( 'html, body' ).stop();
        }
    } );
    </script>

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

Viewing 9 replies - 1 through 9 (of 9 total)
Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘WooCommerce Cart – fix to stop auto scrolling’ is closed to new replies.