Jump to content

How to remove the page scrolling to top functionality after press add to cart button


Recommended Posts

Try the following:

 

Go to /themes/themename/js/modules/blocklayered and open up blocklayered.js.

Find the following code:

if(slideUp)
    $.scrollTo('.product_list', 400);
updateProductUrl();

and change it to

/* if(slideUp)
    $.scrollTo('.product_list', 400);
updateProductUrl(); */

Let me know if this works

Link to comment
Share on other sites

Try the following:

 

Go to /themes/themename/js/modules/blocklayered and open up blocklayered.js.

Find the following code:

if(slideUp)
    $.scrollTo('.product_list', 400);
updateProductUrl();

and change it to

/* if(slideUp)
    $.scrollTo('.product_list', 400);
updateProductUrl(); */

Let me know if this works

r u sure in blocklayered.js?

Link to comment
Share on other sites

Like helldog2004 said, link to your website could help but I think file is ajax-cart.js.

It could be in your theme folder js/modules/blockcart/ or in root modules/blockcart.

 

You can check latest version at  https://github.com/PrestaShop/blockcart/blob/master/ajax-cart.js

and look at line 214 // add picture to cart.

Try to comment out all lines until 262 

ajaxCart.updateCartInformation(jsonData, addedFromProductPage);

That should not be commented out/deleted.

 

Note this is just example as your code could be different.

Link to comment
Share on other sites

Okay last resort!

 

open template file of the products like product.tpl, product-list.tpl and the featured template.

Search for something like this:

<a onclick="$('html, body').animate({scrollTop: 0 }, 600);" class="your_class"

Just remove animate and it should be fixed.

Link to comment
Share on other sites

Like helldog2004 said, link to your website could help but I think file is ajax-cart.js.

It could be in your theme folder js/modules/blockcart/ or in root modules/blockcart.

 

You can check latest version at  https://github.com/PrestaShop/blockcart/blob/master/ajax-cart.js

and look at line 214 // add picture to cart.

Try to comment out all lines until 262 

ajaxCart.updateCartInformation(jsonData, addedFromProductPage);

That should not be commented out/deleted.

 

Note this is just example as your code could be different.

I tried with both files but no luck. :mellow:

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...