ahh nvm, sorted it:



jQuery(document).ready(function($){ $('.addtocart').submit(function(){ var data = {action: 'my_special_action',post:$('.addtocart').serialize() }; $.post("<?php echo admin_url('admin-ajax.php'); ?>
", data, function(response){ $(".eshopajax").insertAfter(this).fadeIn(100).html(response).fadeOut(3000); setTimeout (clearCart,200); setTimeout (doRequest,500); setTimeout (clearRequest,3000); }); function doRequest(){ var tdata = {action: 'my_cart'}; $.post("<?php echo admin_url('admin-ajax.php'); ?>
", tdata, function(response){ $(".ajaxcart").insertAfter(this).fadeIn(100).html(response); }); } function clearRequest(){ $(".eshopajax").empty(); } function clearCart(){ $(".ajaxcart").insert(); } return false; });
});


More Solution