var data = jQuery('#product_addtocart_form').serialize();
data += '&isAjax=1';
jQuery('#preloader .loader').fadeIn(300);
try {
jQuery.ajax({
url: url,
dataType: 'json',
type: 'post',
data: data,
success: function (data) {
showMessage(data);
if(data.status != 'ERROR'){
ajax_add_to_cart_post_update(data);
/*code added*/
window.location.href = checkout;
/*code added*/
}
}
});
} catch (e) {
}