Torbz Posted September 22, 2011 Share Posted September 22, 2011 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 More sharing options...
rocky Posted September 25, 2011 Share Posted September 25, 2011 Try changing line 218 (in PrestaShop v1.4.4) of modules/blockcart/ajax-cart.js: var cartBlockOffset = $('#cart_block').offset(); to: var cartBlockOffset = $('#shopping_cart').offset(); Link to comment Share on other sites More sharing options...
Sharak Posted November 6, 2012 Share Posted November 6, 2012 (edited) 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 November 6, 2012 by Sharak (see edit history) 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