Vilius PromoApranga 24 Posted January 5, 2017 Posted January 5, 2017 Hi I would like to change the theme a abit, how to make after paging to the next or previous page in products, to show page top? Not to stay in the same place? 1 Share this post Link to post Share on other sites
darruest 0 Posted July 14, 2017 Posted July 14, 2017 Hi, me too, it's tedious to have to scroll manually on page change... I'm looking for a solution to that, but without success by now. Share this post Link to post Share on other sites
Loboo 9 Posted July 17, 2017 Posted July 17, 2017 Hi, Try this $( '#products' ).on( 'click', '.js-search-link', function( event ) { var target = $( "#header" ); if ( target.length ) { event.preventDefault(); $( 'html, body' ).animate( { scrollTop: target.offset().top+300 }, 1000 ); } }); 2 Share this post Link to post Share on other sites
fpereira 0 Posted September 1, 2017 Posted September 1, 2017 Hi, I'm having same issue. Where to to put you suggested code? Thanks! Hi, Try this $( '#products' ).on( 'click', '.js-search-link', function( event ) { var target = $( "#header" ); if ( target.length ) { event.preventDefault(); $( 'html, body' ).animate( { scrollTop: target.offset().top+300 }, 1000 ); } }); Share this post Link to post Share on other sites
Solution Loboo 9 Posted September 1, 2017 Posted September 1, 2017 Im new prestashop 1.7.2.2 this feature is in stock. Give me address your shop. i will try make compabilty code 1 Share this post Link to post Share on other sites
Snorreh 1 Posted October 16, 2017 Posted October 16, 2017 (edited) Thanks, this works! (added this to /themes/core.js) Edited October 16, 2017 by Snorreh (see edit history) Share this post Link to post Share on other sites
illycoffee 0 Posted November 7, 2017 Posted November 7, 2017 Hi, how could I fix the same issue in 1.7.1.1? Can I use the same code? Didn't understand where to put it in /themes/core.js ... at the bottom? Thanks Share this post Link to post Share on other sites
Snorreh 1 Posted November 8, 2017 Posted November 8, 2017 13 hours ago, illycoffee said: Hi, how could I fix the same issue in 1.7.1.1? Can I use the same code? Didn't understand where to put it in /themes/core.js ... at the bottom? Thanks Yep just copy paste it to the very bottom, that's what did it for me. Share this post Link to post Share on other sites
Tajriba 0 Posted October 21, 2019 Posted October 21, 2019 Works. Thanks! Share this post Link to post Share on other sites
Flower7C3 1 Posted November 12, 2019 Posted November 12, 2019 In PS 1.7.6 it might be this: $(document).ready(() => { prestashop.on('updateProductList', () => { let target = $("#wrapper"); if (target.length) { $('html, body').animate({ scrollTop: target.offset().top }, 0); } }); }); This is taken from @Loboo's solutuon, but I scroll to #wrapper without animation time. 1 Share this post Link to post Share on other sites
Jean Francois G 151 Posted December 3, 2019 Posted December 3, 2019 On 11/12/2019 at 6:21 PM, Flower7C3 said: In PS 1.7.6 it might be this: $(document).ready(() => { prestashop.on('updateProductList', () => { let target = $("#wrapper"); if (target.length) { $('html, body').animate({ scrollTop: target.offset().top }, 0); } }); }); This is taken from @Loboo's solutuon, but I scroll to #wrapper without animation time. Don't work with my prestacrea theme... Is it just for default theme ? 1 Share this post Link to post Share on other sites
Flower7C3 1 Posted December 4, 2019 Posted December 4, 2019 19 hours ago, Jean Francois G said: Don't work with my prestacrea theme... Is it just for default theme ? It works on my custom theme. You have check if updateProductList event and target element exists in Your code. Share this post Link to post Share on other sites
Jean Francois G 151 Posted December 4, 2019 Posted December 4, 2019 how can i do that ? Share this post Link to post Share on other sites
fosilia 2 Posted April 6, 2020 Posted April 6, 2020 Perfect for 1.7.6.4. Thanks. Share this post Link to post Share on other sites
ilisiaraul 2 Posted May 13, 2020 Posted May 13, 2020 The above code works perfect in PS 1.7.6.5 Great job! Share this post Link to post Share on other sites
hshaker 2 Posted May 29, 2020 Posted May 29, 2020 (edited) works perfect in PS 1.7.6.1 --> themes/mytheme/assets/js/custom.js $(document).ready(() => { prestashop.on('updateProductList', () => { let target = $("#wrapper"); if (target.length) { $('html, body').animate({ scrollTop: target.offset().top+350 }, 500); } }); }); Edited May 29, 2020 by hshaker (see edit history) 2 Share this post Link to post Share on other sites
Toshi_akea 1 Posted June 1, 2020 Posted June 1, 2020 (edited) I put it at the botton, but didn't work for me 😕 Prestashop 1.7.6.5 themes/mytheme/assets/js/custom.js Edited June 1, 2020 by Toshi_akea (see edit history) Share this post Link to post Share on other sites
hasan.shaker 1 Posted June 1, 2020 Posted June 1, 2020 It’s normal, you have to empty the cache 1 Share this post Link to post Share on other sites
Toshi_akea 1 Posted June 3, 2020 Posted June 3, 2020 On 6/1/2020 at 2:08 PM, hasan.shaker said: It’s normal, you have to empty the cache It works! Thanks! Share this post Link to post Share on other sites
Oleg Tortajada 0 Posted Tuesday at 11:32 AM Posted Tuesday at 11:32 AM Actually not works for 1.7.7.0 Share this post Link to post Share on other sites
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now