HL
03/05/2020, 11:08 PMmichoel
03/05/2020, 11:16 PMmichoel
03/05/2020, 11:16 PMfunction shouldIgnoreAlert(message) {
var IGNORED_ALERTS = [
/^The line total amount is not equal to the item price times the quantity$/,
];
return IGNORED_ALERTS.some(function(regex){
return regex.test(message);
});
}
var nativeAlert = window.alert;
window.alert = function() {
if (shouldIgnoreAlert(arguments[0])) {
console.log('Alert suppressed - ' + arguments[0]);
} else {
return nativeAlert.apply(this, arguments);
}
};
michoel
03/05/2020, 11:16 PMHL
03/05/2020, 11:18 PMmichoel
03/05/2020, 11:19 PMmichoel
03/05/2020, 11:19 PMmichoel
03/05/2020, 11:20 PMignoreFieldChange
to true when you set the amount and that doesn't stop the alerts?HL
03/05/2020, 11:25 PMmichoel
03/05/2020, 11:26 PMmichoel
03/05/2020, 11:26 PMHL
03/05/2020, 11:28 PMHL
03/06/2020, 12:19 AMmichoel
03/06/2020, 12:25 AMHL
03/06/2020, 12:34 AMmichoel
03/06/2020, 12:35 AMHL
03/06/2020, 12:39 AMfunction pageInit(){
function shouldIgnoreAlert(message) {
var IGNORED_ALERTS = [
/^The line total amount is not equal to the item price times the quantity$/,
];
return IGNORED_ALERTS.some(function(regex){
return regex.test(message);
});
}
var nativeAlert = window.alert;
window.alert = function() {
if (shouldIgnoreAlert(arguments[0])) {
console.log('Alert suppressed - ' + arguments[0]);
} else {
return nativeAlert.apply(this, arguments);
}
};
}
HL
03/06/2020, 12:39 AM