From 47965cf5ed193d54d8ea2829f319a92a03c1fe4c Mon Sep 17 00:00:00 2001 From: Marion Muszynski Date: Thu, 17 Aug 2017 16:03:52 +0200 Subject: [PATCH] fix go next --- themes/site/js/cart-summary.js | 8 +++++--- themes/site_mobile/js/cart-summary.js | 8 +++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/themes/site/js/cart-summary.js b/themes/site/js/cart-summary.js index b040018a..064f8b3f 100755 --- a/themes/site/js/cart-summary.js +++ b/themes/site/js/cart-summary.js @@ -479,6 +479,9 @@ function updateCartSummary(json) function giftMessage(add, next, all){ var async = true; var got_next = false; + if(next==true){ + got_next = true; + } var action = "add_message"; if(add == false){ if(all == true || !$('input#gift').is(':checked')) { @@ -520,6 +523,7 @@ function giftMessage(add, next, all){ } } alert(errors); + got_next = false; } else { @@ -541,12 +545,10 @@ function giftMessage(add, next, all){ $('#my_gift').hide(); $('#gift_message').val(''); } - if(next==true){ - got_next = true; - } } }, error: function(XMLHttpRequest, textStatus, errorThrown) { + got_next = false; console.log("ERROR\n\nDetails:\nError thrown: " + XMLHttpRequest + "\n" + 'Text status: ' + textStatus + "\n" + 'errorThrown: ' + errorThrown); } }); diff --git a/themes/site_mobile/js/cart-summary.js b/themes/site_mobile/js/cart-summary.js index 2155a333..30666d35 100755 --- a/themes/site_mobile/js/cart-summary.js +++ b/themes/site_mobile/js/cart-summary.js @@ -467,6 +467,9 @@ function updateCartSummary(json) function giftMessage(add, next, all){ var async = true; var got_next = false; + if(next==true){ + got_next = true; + } var action = "add_message"; if(add == false){ if(all == true || !$('input#gift').is(':checked')) { @@ -506,6 +509,7 @@ function giftMessage(add, next, all){ if(error != 'indexOf') errors += jsonData.errors[error] + "\n"; alert(errors); + got_next = false; } else { @@ -516,12 +520,10 @@ function giftMessage(add, next, all){ $('#gift_div').hide(); $('#gift').removeAttr('checked'); } - if(next==true){ - got_next = true; - } } }, error: function(XMLHttpRequest, textStatus, errorThrown) { + got_next = false; //alert("TECHNICAL ERROR: unable to save update quantity \n\nDetails:\nError thrown: " + XMLHttpRequest + "\n" + 'Text status: ' + textStatus); } });