Skip to content
Snippets Groups Projects
Commit e0fbe7b5 authored by rde's avatar rde
Browse files

[FIX] website_sale: disable checkout btn if GTS unchecked at load

opw-774286

*Before this commit:
On checkout, you can enable a step to force user to have the General Terms of
Sale checked to continue the checkout. Checking/Unchecking will correctly
disabled/enabled the button.
The checkbox is already checked at page load (on the template).
BUT, if the template has been modified to set the checkbox as unchecked at load
(eg the user removed 'checked="checked"' from the template), the button will
still be enabled even if the checkbox is unchecked.

*Now:
No matter if it is checked or not on the template, the button will
correctly be enabled/disabled regarding the checkbox state at load.
parent 6e46ba7b
Branches
Tags
No related merge requests found
......@@ -6,9 +6,10 @@ var ajax = require('web.ajax');
$(document).ready(function () {
// If option is enable
if ($("#checkbox_cgv").length) {
$("#checkbox_cgv").click(function() {
$("#checkbox_cgv").change(function() {
$("div.oe_sale_acquirer_button").find('input, button').prop("disabled", !this.checked);
});
$('#checkbox_cgv').trigger('change');
}
// When choosing an acquirer, display its Pay Now button
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment