Modif pour RAZ les autres choix de mode de livraison, autres que le choix en cours.
This commit is contained in:
@@ -109,5 +109,20 @@
|
|||||||
initMapCnc();
|
initMapCnc();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$("#form-cart-delivery").off('submit').submit(function(ev) {
|
||||||
|
if ($('[delivery-mode=cnc]').is(':checked')) {
|
||||||
|
|
||||||
|
// On RAZ les éventuelles sélections préalables.
|
||||||
|
if (typeof $('input[name=pdr-choosen-day]:checked').val() != 'undefined')
|
||||||
|
$('input[name=pdr-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=cnc-choosen-day]:checked').length === 0) {
|
||||||
|
alert("Veuillez choisir un point Click and Collect.");
|
||||||
|
ev.preventDefault();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -85,27 +85,19 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
$("#form-cart-delivery").off('submit').submit(function(ev) {
|
$("#form-cart-delivery").off('submit').submit(function(ev) {
|
||||||
if ($('[delivery-mode=lps]').is(':checked')
|
if ($('[delivery-mode=lps]').is(':checked')) {
|
||||||
&&
|
|
||||||
$('input[name=lps-choosen-day]:checked').length === 0) {
|
|
||||||
alert("Veuillez choisir un jour de livraison.");
|
|
||||||
ev.preventDefault();
|
|
||||||
}
|
|
||||||
|
|
||||||
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=pdr-choosen-day]:checked').length === 0) {
|
$('input[name=cnc-choosen-day]:checked').prop("checked", false);
|
||||||
alert("Veuillez choisir un point de retrait.");
|
if (typeof $('input[name=pdr-choosen-day]:checked').val() != 'undefined')
|
||||||
ev.preventDefault();
|
$('input[name=pdr-choosen-day]:checked').prop("checked", false);
|
||||||
}
|
|
||||||
|
|
||||||
if ($('[delivery-mode=cnc]').is(':checked')
|
if ($('input[name=lps-choosen-day]:checked').length === 0) {
|
||||||
&&
|
alert("Veuillez choisir un jour de livraison.");
|
||||||
$('input[name=cnc-choosen-day]:checked').length === 0) {
|
ev.preventDefault();
|
||||||
alert("Veuillez choisir un point Click and Collect.");
|
}
|
||||||
ev.preventDefault();
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -215,4 +215,20 @@
|
|||||||
initMaps();
|
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>
|
</script>
|
||||||
Reference in New Issue
Block a user