Jump to content

Changing add to cart animation behaviour and anchors


Torbz

Recommended Posts

Hi folks,

 

I'm working on a new site and was wondering if it possible to affect the behaviour of the add to cart animation.

 

If you take a look at a product page:

 

http://bluecedaronline.co.uk/product.php?id_product=21

 

and add to cart, the javascript animation shoots off to the hidden left column (where the cart would normally live).

 

I'm actually never displaying this left column, and was hoping to make the add to cart animation drop down into the <li id="shopping_cart"> in the <ul id="header_nav"> which I've glued to the bottom of each page.

 

Could someone please advise or make offers to do this work for/with me?

 

Thanks in advance.

 

Torbz

x

Link to comment
Share on other sites

  • 1 year later...

I was trying to do the opposite. By default in presta 1.5+ add-to-cart animations fly to #shopping_cart in header but I disabled this section and wanted to use the one in left column. Unfortunately animations wouldn't work that way or fly to top left corner of the page. To make it right you just have to change ajax-cart.js (from line 219) as follows:

var pictureOffset = $picture.offset();
if ($('#left_column #cart_block').offset().top && $('#left_column #cart_block').offset().left)
 var cartBlockOffset = $('#left_column #cart_block').offset();

Edited by Sharak (see edit history)
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...