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
- This topic has 4 replies, 2 voices, and was last updated 4 months ago by Aizaz Imtiaz Awan.
-
AuthorPosts
-
August 8, 2024 at 1:01 pm #588978
qtwrk555ParticipantHi,
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,
August 8, 2024 at 5:31 pm #589074
Aizaz Imtiaz AwanKeymasterHello,
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.
August 8, 2024 at 5:37 pm #589077
qtwrk555ParticipantHI,
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
August 8, 2024 at 5:39 pm #589081
qtwrk555Participantthe 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
August 9, 2024 at 12:37 pm #589241
Aizaz Imtiaz AwanKeymasterHello,
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/effgWQhzLq4LeOZHGeBMSwQNGudxjMDefault WordPress theme Twenty Twenty-Four
https://monosnap.com/file/TR2GMDYqHXh51oc3Pi5VwsiLDzCw5XSince 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.
-
AuthorPosts
- You must be logged in to create new topics. Login / Register