// Changed error management of ajax cart #PSCFV-3646

This commit is contained in:
dMetzger committed 2012-08-17 07:36:36 +00:00
1 parent bd56ebf337
commit 76ab2209a1
1 file changed
+2 -6
+2 -6
View File
@@ -120,9 +120,8 @@ var ajaxCart = {
} }
}, },
// cart to fix display when using back and previous browsers buttons // Fix display when using back and previous browsers buttons
refresh : function(){ refresh : function(){
//send the ajax request to the server
$.ajax({ $.ajax({
type: 'GET', type: 'GET',
url: baseUri, url: baseUri,
@@ -133,9 +132,6 @@ var ajaxCart = {
success: function(jsonData) success: function(jsonData)
{ {
ajaxCart.updateCart(jsonData); ajaxCart.updateCart(jsonData);
},
error: function(XMLHttpRequest, textStatus, errorThrown) {
//alert("TECHNICAL ERROR: unable to refresh the cart.\n\nDetails:\nError thrown: " + XMLHttpRequest + "\n" + 'Text status: ' + textStatus);
} }
}); });
}, },
@@ -241,7 +237,7 @@ var ajaxCart = {
}, },
error: function(XMLHttpRequest, textStatus, errorThrown) error: function(XMLHttpRequest, textStatus, errorThrown)
{ {
alert("TECHNICAL ERROR: unable to add the product.\n\nDetails:\nError thrown: " + XMLHttpRequest + "\n" + 'Text status: ' + textStatus); alert("Impossible to add the product to the cart.\n\ntextStatus: '" + textStatus + "'\nerrorThrown: '" + errorThrown + "'\nresponseText:\n" + XMLHttpRequest.responseText);
//reactive the button when adding has finished //reactive the button when adding has finished
if (addedFromProductPage) if (addedFromProductPage)
$('body#product p#add_to_cart input').removeAttr('disabled').addClass('exclusive').removeClass('exclusive_disabled'); $('body#product p#add_to_cart input').removeAttr('disabled').addClass('exclusive').removeClass('exclusive_disabled');