I am trying to show a confirmation message in jQuery Dialog after adding a product into cart using AJAX.
I have tried using jQuery to achieve this. But it reloads the page(Although it adds the product to cart). I want to show a dialog as soon as a product is added into cart.
I am using Drupal Commerce Kickstart Distribution which comes with AJAX add to cart functionality. This is the code that I am using in my custom module that shows up dialog. (The dialog is shown when a user clicks on "add to cart" button, however, the page gets reloaded as well).
(function ($) {
// all my code here.
Drupal.behaviors.a_mods = {
attach: function(context) {
$('.dahdah').click( function(){
$('#success-message').dialog();
})
}};
})(jQuery);
If this is not possible to achieve this functionality this way, then please point me in the right direction. Thanks.