Modif pour RAZ les autres choix de mode de livraison, autres que le choix en cours.

This commit is contained in:
2021-04-19 12:43:45 +02:00
parent 928b426195
commit f70c1d0f7e
3 changed files with 41 additions and 18 deletions

View File

@@ -215,4 +215,20 @@
initMaps();
}
$("#form-cart-delivery").off('submit').submit(function(ev) {
if ($('[delivery-mode=pdr]').is(':checked')) {
// On RAZ les éventuelles sélections préalables.
if (typeof $('input[name=cnc-choosen-day]:checked').val() != 'undefined')
$('input[name=cnc-choosen-day]:checked').prop("checked", false);
if (typeof $('input[name=lps-choosen-day]:checked').val() != 'undefined')
$('input[name=lps-choosen-day]:checked').prop("checked", false);
if ($('input[name=pdr-choosen-day]:checked').length === 0) {
alert("Veuillez choisir un point de retrait.");
ev.preventDefault();
}
}
});
</script>