telnett Posted July 7, 2014 Share Posted July 7, 2014 Hello, I'm using this advice to add items to the cart directly from CMS. http://www.prestashop.com/forums/topic/173355-add-to-cart-in-a-cms-page/ The script is working correctly, however, there is no animation. I could not find any related topcs here nor any hints on how to force animation when adding to cart this way. Link to comment Share on other sites More sharing options...
vekia Posted July 7, 2014 Share Posted July 7, 2014 you have to insert correspond product image to <div> where add to cart button appears, you've got it? Link to comment Share on other sites More sharing options...
telnett Posted July 7, 2014 Author Share Posted July 7, 2014 you have to insert correspond product image to <div> where add to cart button appears, you've got it? I only had this basic html, no divs or images yet. Something like this? <div><img src='some_image.jpg'><a onclick="ajaxCart.add(product_id=45, null, true, null, quantity=1, null);">Add to cart</a></div> Well, I must be doing it wrong because it didn't helped. Link to comment Share on other sites More sharing options...
vekia Posted July 7, 2014 Share Posted July 7, 2014 image (or its parent <a> element must have class="" param like other images for example - on category pages: product_img_link try to use something like: <a class="product_img_link"><img src=""/></a> Link to comment Share on other sites More sharing options...
telnett Posted July 7, 2014 Author Share Posted July 7, 2014 (edited) image (or its parent <a> element must have class="" param like other images for example - on category pages: product_img_link try to use something like: <a class="product_img_link"><img src=""/></a> ok, well this one did not worked either, but you got me back on the track. I have just pasted a bunch of html from my list view page and now I can get some distorted stuff to fly roughly towards the cart so I believe I'll work my way throught this by cleaning that html out tag by tag. Thank you for your attention and quick response, I appreciate it! EDIT: Adding the code that works for me My solution: <img class="add_to_cart_image" src='/image_url.jpg'> <a class="button ajax_add_to_cart_button exclusive" rel="ajax_id_product_45" href="/cart?add=&id_product=45" title="Add to Cart">Add to Cart</a> Edited July 7, 2014 by telnett (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted July 7, 2014 Share Posted July 7, 2014 great :-) thank you for sharing solution is there any chance to see how it works in real shop? 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