Home Forums WoodMart support forum disable scroll back to top on auto-update-cart action

disable scroll back to top on auto-update-cart action

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #588978

    qtwrk555
    Participant

    Hi,

    as my screen recording , you can see, when you modify the cart items with

    I tried disable opton

    Theme Setting -> Product arhive -> product archive -> Scroll to top after AJAX

    but seems make no difference

    any possible way to make it not to scroll back to top after change quantity ?

    best regards,

    #589074

    Hello,

    Sorry to hear about the inconvenience. Kindly, please share your Site WP-ADMIN Login details in the Private Content field so that we can check this concern on your Site and help you out accordingly.

    Best Regards.

    #589077

    qtwrk555
    Participant

    HI,

    you don’t need to access to my site , the issue was reproduced on your demo site here

    https://woodmart.xtemos.com/home/

    add like 10 , 20 products into cart, then in cart page , modify the quantity of product that shows at low-half page , you will see the issue , as it jumps back to top

    #589081

    qtwrk555
    Participant

    the previous one was not clear, please check this one , on YOUR DEMO site

    I update the quantity to 4 , it auto-updates , then it scrolls up to top , I want to remove this scroll-up-to-top effect on this page

    #589241

    Hello,

    The “Scroll to top after AJAX” option only applies to the product archive and is not related to the cart page. This issue is not a bug in the theme but rather a feature of how the WooCommerce plugin works on the cart page. After the cart is updated, the window automatically scrolls up to the notice that appears above the table. Here is a video from other standard themes where you can see that the cart behaves similarly, as in all cases, this behavior depends on the plugin, not the theme.

    Default WooCommerce theme Storefront
    https://monosnap.com/file/effgWQhzLq4LeOZHGeBMSwQNGudxjM

    Default WordPress theme Twenty Twenty-Four
    https://monosnap.com/file/TR2GMDYqHXh51oc3Pi5VwsiLDzCw5X

    Since this scrolling is triggered by the plugin and not the theme, we cannot completely change or remove it within the theme files. However, as an alternative solution, we can provide the following custom code that will partially mitigate the scrolling effect, though screen jumps may still occur since it is, unfortunately, impossible to eliminate it entirely through the theme. The code needs to be added in the Global Custom JS field, which is located in the Custom JS section of the Theme Settings.

    (function($) {
    	$( document.body ).on( 'updated_wc_div', function() {		
    		setTimeout(function() {
    			$( 'html, body' ).stop()
    		});
    	});
    })(jQuery)

    Best Regards.

Viewing 5 posts - 1 through 5 (of 5 total)