[FIX] website_sale: Pay Now button is clickable even without clicking policies and conditions

Steps to reproduce the bug:

-Go to the shop
-Add an item to card
-Checkout
-Insert address info
-Click proceed
-Enable "Accept Terms & Conditions"
-With the HTML Editor, remove the attribute checked="checked" in template Accept Terms & Conditions

Bug:

-Pay Now button is clickable but the Policy and Procedures box was not checked.

opw:771418
This commit is contained in:
Goffin Simon
2017-09-14 10:57:02 +02:00
parent 3d2a7a0d12
commit 77566f5067
@@ -6,9 +6,10 @@ var ajax = require('web.ajax');
$(document).ready(function () {
// If option is enable
if ($("#checkbox_cgv").length) {
$("#checkbox_cgv").click(function() {
var enabling_button = function() {
$("div.oe_sale_acquirer_button").find('input, button').prop("disabled", !this.checked);
});
};
$("#checkbox_cgv").click(enabling_button).each(enabling_button);
}
// When choosing an acquirer, display its Pay Now button