Jump to content

After clicking "Add to cart" jump to an anchor to the top of the Page


Thanatos

Recommended Posts

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 by Thanatos (see edit history)
Link to comment
Share on other sites

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...