Thanatos Posted March 14, 2014 Share Posted March 14, 2014 (edited) Hi, our product page is very long because we have a lot of combinations. If the costumer select his combinations and click the "add to cart" botton on the bottom of the page it is not possible to see how the product image slides into the shopping cart. I would like now set an anchor on the top of the page (next the shopping cart). That`s no problem. My goal is, if you click the "add to cart" botton, that the view jumps to the anchor on the top of the page. I guess, that something must be changed in the product.js but I don`t know, what code I have where to implement. I am no developer. Is there anybody who have an Idea or solution for my problem? We are using Prestashop v1.5.4.1 Regards, Christian Edited March 14, 2014 by Thanatos (see edit history) Link to comment Share on other sites More sharing options...
Krystian Podemski Posted March 14, 2014 Share Posted March 14, 2014 (edited) Hello, Something like that? $('.addToCartButtonSelector').on('click', function (e) { $('html, body').animate({scrollTop: '0px'}, 800); } ); Edited March 14, 2014 by Krystian Podemski (see edit history) Link to comment Share on other sites More sharing options...
dioniz Posted March 14, 2014 Share Posted March 14, 2014 Or in modules/blockcart/ajax-cart.js after following lines of code: .fadeOut(100, function() { ajaxCart.updateCartInformation(jsonData, addedFromProductPage); $(this).remove(); }); add this code: $('body,html').animate({ scrollTop: 0 }, 1200); Link to comment Share on other sites More sharing options...
Thanatos Posted March 14, 2014 Author Share Posted March 14, 2014 Hi dioniz, it works, great job! Thank you very much! Regards, Christian Link to comment Share on other sites More sharing options...
dioniz Posted March 14, 2014 Share Posted March 14, 2014 You are welcome Christian Link to comment Share on other sites More sharing options...
Thanatos Posted March 15, 2014 Author Share Posted March 15, 2014 Hi, now I`ve discovered, that it only works with Firefox and not with Chrome und IE. That`s crazy. What can I do that it works with several browsers? Regards, Christian Link to comment Share on other sites More sharing options...
dioniz Posted March 15, 2014 Share Posted March 15, 2014 Works for me in Chrome and also IE8... Try to clear browser cache Link to comment Share on other sites More sharing options...
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