"Add to cart" form using AJAX
Anyone edited the "Add to cart" form in order to use AJAX to insert products in the cart without reloading the page and showing a "Product added to cart" message popup in the center of the page?
Any hint on how to do that?
Comments
I "hijacked" the form
I "hijacked" the form.commerce-add-to-cart input.form-submit button's click function with jQuery and now when the user click it a popup message appears to her:
(function($) {
$(document).ready(function() {
$("form.commerce-add-to-cart input.form-submit").click(function() {
$("div#my-popup").slideToggle().delay(8000).fadeOut();
return false;
});
});
})(jQuery);
Now I just need a way to submit the commerce-add-to-cart form via jQuery.
How can I do that? AJAX call?
Thank you for any hint.
Greetings, Giovanni
Commerce Cart Ajax
It exists a module which should already do that, but it still doesn't work at the moment.
http://drupal.org/node/1316644#comment-6714652
Can't edit
Sorry for the internal reference to my comment.
http://drupal.org/node/1316644