• Hello Team

    I am facing an issue with WordPress version 6.4.2, I have two e-commerce WordPress websites The issue I am facing is that on the page load of the single product page, my page automatically scrolls down to the woocommerce product description tab to debug this issue on the staging firstly I have updated the themes and plugins of my site the issue does not come up also cleared the cache and checked in the private window but the issue does not come up after that when I have updated the WordPress version to 6.4.2 the issue came up all my single product page automatically scroll down to the product description on page load.

    Can you please help me I am facing the same issue on both e-commerce websites.

    Thanks

Viewing 8 replies - 1 through 8 (of 8 total)
  • Hey @adityabelievintech

    Can you replicate the same issue with a default WordPress theme?
    If the issue is not there with the default theme, most likely, there is a script in your current theme that causes the scrolling.

    It’s best to contact the theme’s support team.

    Cheers,
    Nastia

    Thread Starter adityabelievintech

    (@adityabelievintech)

    Hi Nastia Kolomoytseva(@nastaia)

    Thanks for the reply

    I will be following the steps you have mentioned and get back to you.

    Thread Starter adityabelievintech

    (@adityabelievintech)

    Hi?Nastia Kolomoytseva(@nastaia)

    Getting back to this issue I activated the default theme on my site, and the issue was resolved. After that, I again activated my theme and again the issue came up to resolve this issue I found that in the theme there was a JS code, which was causing the issue. So I copied that, added it to the default theme, activated the default theme, and in the default theme again, that issue came up.

    To debug the JS issue, I added the console. log in to the JS click function, and check on the page load. The click was triggered, although i had not clicked the woo-commerce tab, and the click was triggered on the page load.

    Below is the js code.

    
    jQuery(document).ready(function(){
    
          jQuery(".woocommerce div.product .woocommerce-tabs ul.tabs li > a").on('click',function () {
    
                console.log('scroll trigger');
    
                if (
    
                    (jQuery(this).find("span.fa-plus").hasClass("fa-minus")
    
                        ? (jQuery(this).find("span.fa-plus").removeClass("fa-minus"), jQuery(this).parent("li").find(".wc-tab").removeClass("d-block"))
    
                        : (jQuery(this).find("span.fa-plus").addClass("fa-minus"), jQuery(this).parent("li").find(".wc-tab").addClass("d-block")),
    
                    jQuery(window).width() > 992)
    
                ) {
    
                    console.log('if condition scroll');
    
                    var e = jQuery(this).attr("href");
    
                    jQuery("html, body").animate({ scrollTop: jQuery(e).offset().top - 30 }, 1e3, "linear");
    
                } else (e = jQuery(this).parent("li")), jQuery("html, body").animate({ scrollTop: jQuery(e).offset().top - 10 }, 1e3, "linear");
    
                console.log(e);
    
            })
    
        });

    Screenshot for reference https://prnt.sc/r7jTkEX9pNiG

    Can you please help me with this I added this js code in the default theme and the issue came up.

    Thanks in advance

    Thread Starter adityabelievintech

    (@adityabelievintech)

    Also, I have deactivated all the plugins and kept the woo-commerce activated but still the issue is coming

    Thread Starter adityabelievintech

    (@adityabelievintech)

    Nastia Kolomoytseva(@nastaia) following up on this one.

    After that, I again activated my theme and again the issue came up to resolve this issue I found that in the theme there was a JS code, which was causing the issue.

    Hi @adityabelievintech from what you mentioned above the code causing the issue is provided by the theme you are using. The WooCommerce plugin is tested with the StoreFront theme. If you activate the StoreFront theme on your site does the issue persist?

    If not you can loop in the developers of the theme so that they can advise take a look and advise.

    Thread Starter adityabelievintech

    (@adityabelievintech)

    thelmachido a11n(@thelmachido) Thanks for the reply

    This JS was also getting triggered in the default theme on the page load, going more into this issue. I found that there is a JS in the woocommerce plugin that triggers a click on the woocommerce tab on page load, due to which this JS code works, so now I have created a ticket in the woocommerce plugin to resolve this issue.
    Ticket link : – https://www.ads-software.com/support/topic/woocommerce-triggers-click-on-the-woo-tabs-on-page-load/

    Thank You

    ?@adityabelievintech hey, did you ever find out the source of this scroll issue? i’m having the same issue on my product page.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘WP Version 6.4.2 Auto Scroll the page to bottom’ is closed to new replies.