Developer forum

Forum » Swift » Cart page always jumps to the top of the page when adjusting quantities

Cart page always jumps to the top of the page when adjusting quantities

Jon Thorne
Jon Thorne
Reply

Hi,

On the cart page when you have a few things in the cart and scroll down. Then adjust the quantity, either by using the up/down arrow or typing a number, the whole page always refreshes to update all the values and prices on the page. This causes the page to jump to the top and refresh. This is not a great user expreience and makes the page very slow to use and confusing. Is there any plan to update this process to use a background javascript post to update this information?

Regards, Jon.


Replies

 
Shiwanka Chathuranga Dynamicweb Employee
Shiwanka Chathuranga
Reply

Hi Jon

for this i can give you solution for current swift implimentation,

<script>
        document.addEventListener("DOMContentLoaded", function(event) { 
            var scrollpos = localStorage.getItem('scrollpos');
            if (scrollpos) window.scrollTo(0, scrollpos);
        });
        window.onbeforeunload = function(e) {
            localStorage.setItem('scrollpos', window.scrollY);
        };
    </script>

 

But i agreed with you to have ajax base data loading to be implement for best user experience 

 

You must be logged in to post in the forum