Show no internet error if operation can not be completed due to network issue
This commit is contained in:
@@ -478,23 +478,27 @@ var ajaxCart = {
|
||||
|
||||
},
|
||||
error: function(XMLHttpRequest, textStatus, errorThrown) {
|
||||
var error = "Impossible to add the room to the cart.<br/>textStatus: '" + textStatus + "'<br/>errorThrown: '" + errorThrown + "'<br/>responseText:<br/>" + XMLHttpRequest.responseText;
|
||||
if (!!$.prototype.fancybox)
|
||||
$.fancybox.open([{
|
||||
type: 'inline',
|
||||
autoScale: true,
|
||||
minHeight: 30,
|
||||
content: '<p class="fancybox-error">' + error + '</p>'
|
||||
}], {
|
||||
padding: 0
|
||||
});
|
||||
else
|
||||
alert(error);
|
||||
//reactive the button when adding has finished
|
||||
if (addedFromProductPage)
|
||||
$('#add_to_cart button').removeProp('disabled').removeClass('disabled');
|
||||
else
|
||||
$(callerElement).removeProp('disabled');
|
||||
if (XMLHttpRequest.readyState == 0) {
|
||||
showErrorMessage(no_internet_txt);
|
||||
} else {
|
||||
var error = "Impossible to add the room to the cart.<br/>textStatus: '" + textStatus + "'<br/>errorThrown: '" + errorThrown + "'<br/>responseText:<br/>" + XMLHttpRequest.responseText;
|
||||
if (!!$.prototype.fancybox)
|
||||
$.fancybox.open([{
|
||||
type: 'inline',
|
||||
autoScale: true,
|
||||
minHeight: 30,
|
||||
content: '<p class="fancybox-error">' + error + '</p>'
|
||||
}], {
|
||||
padding: 0
|
||||
});
|
||||
else
|
||||
alert(error);
|
||||
//reactive the button when adding has finished
|
||||
if (addedFromProductPage)
|
||||
$('#add_to_cart button').removeProp('disabled').removeClass('disabled');
|
||||
else
|
||||
$(callerElement).removeProp('disabled');
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
@@ -612,23 +616,27 @@ var ajaxCart = {
|
||||
|
||||
},
|
||||
error: function(XMLHttpRequest, textStatus, errorThrown) {
|
||||
var error = "Impossible to add the room to the cart.<br/>textStatus: '" + textStatus + "'<br/>errorThrown: '" + errorThrown + "'<br/>responseText:<br/>" + XMLHttpRequest.responseText;
|
||||
if (!!$.prototype.fancybox)
|
||||
$.fancybox.open([{
|
||||
type: 'inline',
|
||||
autoScale: true,
|
||||
minHeight: 30,
|
||||
content: '<p class="fancybox-error">' + error + '</p>'
|
||||
}], {
|
||||
padding: 0
|
||||
});
|
||||
else
|
||||
alert(error);
|
||||
//reactive the button when adding has finished
|
||||
if (addedFromProductPage)
|
||||
$('#add_to_cart button').removeProp('disabled').removeClass('disabled');
|
||||
else
|
||||
$(callerElement).removeProp('disabled');
|
||||
if (XMLHttpRequest.readyState == 0) {
|
||||
showErrorMessage(no_internet_txt);
|
||||
} else {
|
||||
var error = "Impossible to add the room to the cart.<br/>textStatus: '" + textStatus + "'<br/>errorThrown: '" + errorThrown + "'<br/>responseText:<br/>" + XMLHttpRequest.responseText;
|
||||
if (!!$.prototype.fancybox)
|
||||
$.fancybox.open([{
|
||||
type: 'inline',
|
||||
autoScale: true,
|
||||
minHeight: 30,
|
||||
content: '<p class="fancybox-error">' + error + '</p>'
|
||||
}], {
|
||||
padding: 0
|
||||
});
|
||||
else
|
||||
alert(error);
|
||||
//reactive the button when adding has finished
|
||||
if (addedFromProductPage)
|
||||
$('#add_to_cart button').removeProp('disabled').removeClass('disabled');
|
||||
else
|
||||
$(callerElement).removeProp('disabled');
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
@@ -675,19 +683,23 @@ var ajaxCart = {
|
||||
deleteProductFromSummary(idProduct + '_' + idCombination + '_' + customizationId + '_' + idAddressDelivery);
|
||||
}*/
|
||||
},
|
||||
error: function() {
|
||||
var error = 'ERROR: unable to delete the product';
|
||||
if (!!$.prototype.fancybox) {
|
||||
$.fancybox.open([{
|
||||
type: 'inline',
|
||||
autoScale: true,
|
||||
minHeight: 30,
|
||||
content: error
|
||||
}], {
|
||||
padding: 0
|
||||
});
|
||||
} else
|
||||
alert(error);
|
||||
error: function(jqXHR) {
|
||||
if (jqXHR.readyState == 0) {
|
||||
showErrorMessage(no_internet_txt);
|
||||
} else {
|
||||
var error = 'ERROR: unable to delete the product';
|
||||
if (!!$.prototype.fancybox) {
|
||||
$.fancybox.open([{
|
||||
type: 'inline',
|
||||
autoScale: true,
|
||||
minHeight: 30,
|
||||
content: error
|
||||
}], {
|
||||
padding: 0
|
||||
});
|
||||
} else
|
||||
alert(error);
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
@@ -438,6 +438,7 @@
|
||||
{addJsDefL name=duration_txt}{l s='Duration' mod='blockcart' js=1}{/addJsDefL}
|
||||
{addJsDefL name=capacity_txt}{l s='Capacity' mod='blockcart' js=1}{/addJsDefL}
|
||||
{addJsDefL name=remove_rm_title}{l s='Remove this room from my cart' mod='blockcart' js=1}{/addJsDefL}
|
||||
{addJsDefL name=no_internet_txt}{l s='No internet. Please try later.' mod='blockcart' js=1}{/addJsDefL}
|
||||
|
||||
{addJsDef rm_avail_process_lnk = $link->getModuleLink('blockcart', 'checkroomavailabilityajaxprocess')}
|
||||
{addJsDef pagename = $current_page}
|
||||
|
||||
@@ -478,23 +478,27 @@ var ajaxCart = {
|
||||
|
||||
},
|
||||
error: function(XMLHttpRequest, textStatus, errorThrown) {
|
||||
var error = "Impossible to add the room to the cart.<br/>textStatus: '" + textStatus + "'<br/>errorThrown: '" + errorThrown + "'<br/>responseText:<br/>" + XMLHttpRequest.responseText;
|
||||
if (!!$.prototype.fancybox)
|
||||
$.fancybox.open([{
|
||||
type: 'inline',
|
||||
autoScale: true,
|
||||
minHeight: 30,
|
||||
content: '<p class="fancybox-error">' + error + '</p>'
|
||||
}], {
|
||||
padding: 0
|
||||
});
|
||||
else
|
||||
alert(error);
|
||||
//reactive the button when adding has finished
|
||||
if (addedFromProductPage)
|
||||
$('#add_to_cart button').removeProp('disabled').removeClass('disabled');
|
||||
else
|
||||
$(callerElement).removeProp('disabled');
|
||||
if (XMLHttpRequest.readyState == 0) {
|
||||
showErrorMessage(no_internet_txt);
|
||||
} else {
|
||||
var error = "Impossible to add the room to the cart.<br/>textStatus: '" + textStatus + "'<br/>errorThrown: '" + errorThrown + "'<br/>responseText:<br/>" + XMLHttpRequest.responseText;
|
||||
if (!!$.prototype.fancybox)
|
||||
$.fancybox.open([{
|
||||
type: 'inline',
|
||||
autoScale: true,
|
||||
minHeight: 30,
|
||||
content: '<p class="fancybox-error">' + error + '</p>'
|
||||
}], {
|
||||
padding: 0
|
||||
});
|
||||
else
|
||||
alert(error);
|
||||
//reactive the button when adding has finished
|
||||
if (addedFromProductPage)
|
||||
$('#add_to_cart button').removeProp('disabled').removeClass('disabled');
|
||||
else
|
||||
$(callerElement).removeProp('disabled');
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
@@ -612,23 +616,27 @@ var ajaxCart = {
|
||||
|
||||
},
|
||||
error: function(XMLHttpRequest, textStatus, errorThrown) {
|
||||
var error = "Impossible to add the room to the cart.<br/>textStatus: '" + textStatus + "'<br/>errorThrown: '" + errorThrown + "'<br/>responseText:<br/>" + XMLHttpRequest.responseText;
|
||||
if (!!$.prototype.fancybox)
|
||||
$.fancybox.open([{
|
||||
type: 'inline',
|
||||
autoScale: true,
|
||||
minHeight: 30,
|
||||
content: '<p class="fancybox-error">' + error + '</p>'
|
||||
}], {
|
||||
padding: 0
|
||||
});
|
||||
else
|
||||
alert(error);
|
||||
//reactive the button when adding has finished
|
||||
if (addedFromProductPage)
|
||||
$('#add_to_cart button').removeProp('disabled').removeClass('disabled');
|
||||
else
|
||||
$(callerElement).removeProp('disabled');
|
||||
if (XMLHttpRequest.readyState == 0) {
|
||||
showErrorMessage(no_internet_txt);
|
||||
} else {
|
||||
var error = "Impossible to add the room to the cart.<br/>textStatus: '" + textStatus + "'<br/>errorThrown: '" + errorThrown + "'<br/>responseText:<br/>" + XMLHttpRequest.responseText;
|
||||
if (!!$.prototype.fancybox)
|
||||
$.fancybox.open([{
|
||||
type: 'inline',
|
||||
autoScale: true,
|
||||
minHeight: 30,
|
||||
content: '<p class="fancybox-error">' + error + '</p>'
|
||||
}], {
|
||||
padding: 0
|
||||
});
|
||||
else
|
||||
alert(error);
|
||||
//reactive the button when adding has finished
|
||||
if (addedFromProductPage)
|
||||
$('#add_to_cart button').removeProp('disabled').removeClass('disabled');
|
||||
else
|
||||
$(callerElement).removeProp('disabled');
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
@@ -675,19 +683,23 @@ var ajaxCart = {
|
||||
deleteProductFromSummary(idProduct + '_' + idCombination + '_' + customizationId + '_' + idAddressDelivery);
|
||||
}*/
|
||||
},
|
||||
error: function() {
|
||||
var error = 'ERROR: unable to delete the product';
|
||||
if (!!$.prototype.fancybox) {
|
||||
$.fancybox.open([{
|
||||
type: 'inline',
|
||||
autoScale: true,
|
||||
minHeight: 30,
|
||||
content: error
|
||||
}], {
|
||||
padding: 0
|
||||
});
|
||||
} else
|
||||
alert(error);
|
||||
error: function(jqXHR) {
|
||||
if (jqXHR.readyState == 0) {
|
||||
showErrorMessage(no_internet_txt);
|
||||
} else {
|
||||
var error = 'ERROR: unable to delete the product';
|
||||
if (!!$.prototype.fancybox) {
|
||||
$.fancybox.open([{
|
||||
type: 'inline',
|
||||
autoScale: true,
|
||||
minHeight: 30,
|
||||
content: error
|
||||
}], {
|
||||
padding: 0
|
||||
});
|
||||
} else
|
||||
alert(error);
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
@@ -1458,6 +1458,11 @@ var BookingForm = {
|
||||
BookingForm.init();
|
||||
}
|
||||
},
|
||||
error: function(jqXHR) {
|
||||
if (jqXHR.readyState == 0) {
|
||||
showErrorMessage(no_internet_txt);
|
||||
}
|
||||
},
|
||||
complete: function() {
|
||||
$('.book_now_submit').prop('disabled', false).find('span:not(#booking_action_loader)').show();
|
||||
$('#booking_action_block').find('#booking_action_loader').removeClass('active');
|
||||
|
||||
@@ -438,6 +438,7 @@
|
||||
{addJsDefL name=duration_txt}{l s='Duration' mod='blockcart' js=1}{/addJsDefL}
|
||||
{addJsDefL name=capacity_txt}{l s='Capacity' mod='blockcart' js=1}{/addJsDefL}
|
||||
{addJsDefL name=remove_rm_title}{l s='Remove this room from my cart' mod='blockcart' js=1}{/addJsDefL}
|
||||
{addJsDefL name=no_internet_txt}{l s='No internet. Please try later.' mod='blockcart' js=1}{/addJsDefL}
|
||||
|
||||
{addJsDef rm_avail_process_lnk = $link->getModuleLink('blockcart', 'checkroomavailabilityajaxprocess')}
|
||||
{addJsDef pagename = $current_page}
|
||||
|
||||
Reference in New Issue
Block a user