Show order errors in page instead of in an alert.

This commit is contained in:
Diana Huang
2013-09-12 14:58:34 -04:00
parent a7cb28fc90
commit 14e0a4a038
2 changed files with 16 additions and 1 deletions

View File

@@ -50,7 +50,11 @@ var submitToPaymentProcessing = function() {
$("#pay_form").submit();
})
.fail(function(jqXhr,text_status, error_thrown) {
alert(jqXhr.responseText);
if(jqXhr.status == 400) {
$('#order-error .copy p').html(jqXhr.responseText);
}
$('#order-error').show();
$("html, body").animate({ scrollTop: 0 });
});
}